Android  
ADB and Fastboot Commands

Android Debug Bridge

General

// List of devices attached
adb devices

// Open terminal shell on device to run commands directly
adb shell

// Reboot to fastboot
adb reboot bootloader  or,
adb disable-verity
                  

Package Manager

replace test.apk with proper package name				  
				  
// Returns a list of the package names installed
adb shell pm list packages				         
 * Options  
    -d only return disabled packages
    -e only return enabled packages
    -f path to base APK along with package name
    -s only return system packages
    -3 only return third-party packages
		  
// App installation pushes package to the device
adb install test.apk

// Remove the app package from your device
adb uninstall test.apk
 * Options  
    -k Keeps the data and cache directories after removal

// Disable an application
pm disable test.apk  or,
pm disable-user --user0 test.apk	
 * Re-enable	
pm enable test.apk	

// Hide an application
pm hide test.apk	
 * Re-enable
pm unhide test.apk	

// Suspend an application
pm suspend test.apk	
 * Re-enable
pm unsuspend test.apk	
                  
  Android  

Fastboot

General

// List of devices attached
fastboot devices

// Displays bootloader variables
fastboot getvar All

// Check for fastbootd
fastboot getvar is-userspace	
 * If it returns yes your devices uses fastbootd
 * If no your device uses bootloader/fastboot mode

// Reboot device
fastboot reboot
                  

Flashing

replace test.img with proper image name				  
				  
// Flashing firmware
fastboot flash *Options test.img
 * Example				         
fastboot flash recovery recovery.img				         
 * Options  
    boot boot.img
    recovery recovery.img
    system system.img
    userdata data.img
    zip file.zip (Custom Rom)
                  

Boot to Reboot

// Reboot into recovery
fastboot reboot recovery

// Temporary recovery
fastboot boot recovery.img

// Unlock Bootloader
fastboot oem unlock
 * Status  
fastboot oem device-info
fastboot getvar unlocked

// Temporary recovery
fastboot boot recovery.img
                  
  Android