[Android Software/Hacking General [Developers Only]] K3V1991:
ADB & Fastboot Commands:

----------------------------------------------------------------------------------------------------------------------

ADB Commands:

----------------------------------------------------------------------------------------------------------------------

adb help

Shows ADB Help Documentation.

adb devices

Lists all the Android Devices connected via ADB.

adb reboot

Reboots your Android Device.

adb reboot bootloader

Reboots your Android Device into Fastboot / Bootloader Mode.

adb reboot recovery

Reboots your Android device into Recovery Mode.

adb install

Helps you install an APK File on your Android Device.

adb install filename.apk

Install the APK File.

adb install -r filename.apk

Re-installs or updates an App.

adb install -s filename.apk

Installs the APK File in SD Card (if the App supports).

adb uninstall

Helps you install an App File on your Android Device.

adb uninstall com.facebook.katana

Simply uninstalls the App.

adb uninstall -k com.facebook.katana

Keeps the Data and Cache Folder after the App is uninstalled.

adb logcat

Displays the Log Data onto the Screen.

adb bugreport

Displays the Dumpsys, Dumpstate and Logcat Data on the Screen.

adb jdwp

Lists the JDWP (Java Debug Wire Protocol) Processes on the Device.

adb get-serialno

Shows the adb instance Serial Number String with the Device.

adb get-state

Displays the Device Status.

adb wait-for-device

Used to set a delay before the next Command is issued.

It executes when the Device is online but it can be programmed to wait till another Process is done.

adb start-server

Starts the ADB Server Process.

adb kill-server

Stops the ADB Server Process.

adb sideload <filename.zip>

Used to flash a Zip File in Recovery Mode when the Zip File is available in the Computer.

adb pull </path/filename>

Pulls any File from your Device and saves it on your Computer.

adb push <source-path> <target-path>

Used to push a File into your Android Device.

----------------------------------------------------------------------------------------------------------------------

ADB Shell Commands:

----------------------------------------------------------------------------------------------------------------------

adb shell

Starts the Remote Shell Command Console in the Device.

adb shell pm uninstall -k –user 0 package.name.com

Helps you uninstall a System App from your Android Device.

Replace package.name.com with the actual Package Name.

adb shell dumpsys

Dumps all System Data about your Android Device’s Dardware and Software Configuration

adb shell dumpsys display

Displays all the Hardware and Software Configuration about your Display.

adb shell dumpsys battery

Displays all the Hardware and Software Configuration about your Battery.

adb shell dumpsys batterystats

Displays all the Info about your Battery Statistics.

adb shell wm density

Helps you change the Pixel Density on your Android Device.

adb shell pm list packages

Lists all the Apps installed on your Device as Package Names.

adb shell pm list packages -s

Lists all the System Apps installed on your Device as Package Names.

adb shell pm list packages -3

Lists all the 3rd Party Apps installed on your Device as Package Names.

adb shell pm list packages -d

Lists all the disabled Apps on your Device as Package Names.

adb shell pm list packages -e

Lists all the enabled Apps on your Device as Package Names.

adb shell pm list packages -u

Lists all the uninstalled Apps with installed Pages on your Device as Package Names.

adb shell screencap /sdcard/screenshot.png

Takes a Screenshot of your Device Screen and saves it in SDCARD with the name "screenshot.png".

adb shell screenrecord /sdcard/screenrecord.mp4

Starts recording your Device Screen and saves the Video in SDCARD with the name "screenrecord.mp4".

The default Record Time is 180 Seconds (Maximum). You can press CTRL + C to stop the recording any Time.

adb shell screenrecord –size 1920×1080 /sdcard/screenrecord.mp4

Screen recording with custom Width and Height for the Video.

adb shell screenrecord –time-limit 120 /sdcard/screenrecord.mp4

Screen recording with custom Time Limit for the Video.

Max value is 180.

adb shell screenrecord –bit-rate 4000000 /sdcard/screenrecord.mp4

Screen Recording with custom Bit Rate for the Video.

The Value "4000000" sets the Bitrate to 4Mbmps.

adb shell

<Hit Enter and then execute the following command>

cd /system

Changes the Directory to "/system".

adb shell

<Hit Enter and then execute the following command>

rm -f /sdcard/<filename.zip>

Deletes a File from your Android Device.

adb shell

<Hit Enter and then execute the following command>

crm -d /sdcard/example

Deletes a Folder from your Android Device.

mkdir /sdcard/Android

Creates a new Folder named "Android" under "/sdcard"

cp /sdcard/filename.apk /sdcard/FolderName/

To copy a File.

mv /sdcard/filename.apk /sdcard/FolderName/

To move a File.

mv /sdcard/filename.apk /sdcard/anotherfilename.apk

To rename a File.

adb shell

<Hit Enter and then execute the following command>

netstat

To check the Network Statistics of your Android Device.

adb shell

<Hit Enter and then execute the following command>

ip -f inet addr show wlan0

Displays your Phone’s Wi-Fi IP Address.

adb shell

<Hit Enter and then execute the following command>

top

Displays top CPU Processes running on your Android Device.

adb shell

<Hit Enter and then execute the following command>

getprop ro.build.version.sdk

Used to get the Properties of your Android’s build.prop Configuration.

adb shell

<Hit Enter and then execute the following command>

setprop net.dns1 1.2.3.4

Used to set Values to the Properties present in your Android’s build.prop Configuration.

----------------------------------------------------------------------------------------------------------------------

Fastboot Commands:

----------------------------------------------------------------------------------------------------------------------

fastboot devices

List all the Android Devices that are connected in Fastboot Mode to your Computer.

fastboot oem unlock

Unlocks the Bootloader on your Android Device (if the OEM allows).

fastboot oem lock

Relocks the Bootloader on your Android Device.

fastboot reboot bootloader

Reboots your Device into Fastboot/Bootloader Mode.

fastboot flash

Used to flash Files on your Android Device.

fastboot flash boot filename.img

Flashes boot Image on your Android Device’s Boot Partition.

fastboot flash recovery filename.img

Flashes Recovery Image on your Android Device’s Recovery Partition.

fastboot boot filename.img

Instead of flashing the File, this Command simply boots it (if the file is bootable).

What else can I do with ADB?

Below is a List of XDA Tutorials for various Devices that detail many Applications of ADB Commands in order to modify hidden Settings, customize OEM Features or User Interfaces and much more

How to Uninstall Carrier/OEM Bloatware Without Root Access

How to Increase the Edge Screen Size on Samsung Galaxy Phones Without Root

How to Manually Change the Samsung Galaxy S8, S8+, or Note 8 Navigation Bar Color

How to Force Apps to Fill the Screen on the Essential Phone

How to get “Turn on WiFi Automatically” for the Nexus 5X/6P on Android Oreo

How to Stop Wakelocks from Any Android App Without Root

How to Whitelist Apps from Android Oreo’s Background Location Throttling

How to Hide the “App is Running in the Background” Persistent Notification on Android Oreo

How to Check if Your Android 8.0 Oreo Device Supports Project Treble

Broken Navigation Bar, Lock Screen, or Status Bar after an Update? Here’s a Fix.

How to Sync Do Not Disturb Mode Between Android Wear and Your Phone

How to see the Boot Count of your Android 7.0+ Device

How to Change the SMS Limit on Android Without Root

How to Set a WiFi Network as Metered on Huawei or Honor Devices

How to Downgrade an App on Android – No Root Needed

How to Customize Battery Saver Mode in Android 8.0 Oreo

How to Customize the Navigation Bar in Android Oreo Without Root

How to Access Facebook Messenger’s Hidden Internal Menu

How to Customize which Radios are Disabled in Airplane Mode

How to Pair Android Wear Watches to New Phones without Factory Resetting

How to Stop Pokemon Go (or other apps) From Stealing Audio Focus

How to Stop Vibrations from Any Android App on Your Phone

How to Block Heads Up Notifications while Gaming or Watching a Video

How to Hide the Persistent Notification for Background Apps in Android O

How to Permanently Remove the Google Chromecast Notification

How to Freeze Any App’s Background Processes without Root on Android 7.0+

How to set a Custom Screen Saver on Huawei and Honor devices running EMUI

How to Add more Tiles to the Quick Settings Header on Google, OnePlus, and Sony Phones [No Root]

How to Add Custom Buttons to the Nav Bar on the Samsung Galaxy S8/S8+

How to Add Left/Right Keyboard Cursors to the Nav Bar during Text Input

How to Add Media Playback Controls to the Nav Bar when Playing Music

Three Actually-Hidden, Non-Clickbaity Tricks for Your New Galaxy S8 or S8+

How to change your Nav Bar Icons or Re-arrange the Buttons without Root

Source:

https://www.xda-developers.com/what-is-adb/