The ADB is powerful, and remembering some of the ADB commands can help improve productivity.
1.Get Serial Number:
adb Get-serialno
2.To view the devices that connect to your computer:
ADB devices
3.Restart the machine:
adb reboot
4.Restart to bootloader, which is the brush mode:
adb reboot bootloader
5.Restart to recovery, which is the recovery mode:
adb reboot Recovery
6.View log:
adb logcat
7.To terminate the ADB service process:
adb kill-server
8.To restart the ADB service process:
adb start-server
9.Get Machine MAC Address:
adb shell cat/sys/class/net/wlan0/address
.Get the CPU serial number:
adb shell Cat/proc/cpuinfo
One by one .Install APK:
adb install <apkfile>//For example: adb install baidu.apk
.Keep the data and cache files and reinstall the APK:
adb install-r <apkfile>//For example: adb install-r baidu.apk
.Install apk to SD card:
adb install-s <apkfile>//For example: adb install-s baidu.apk
.Uninstall APK:
adb uninstall <package>//For example: adb uninstall Com.baidu.search
A .Uninstall the app but keep the data and cache files:
adb uninstall-k <package>//For example: adb uninstall-k com.baidu.search
.To launch an app:
adb shell am start-n <package_name>/.<activity_class_name>
.To view the CPU and memory consumption of the device:
adb shell Top
.To see the top 6 apps that occupy memory:
adb shell top-m 6
.Refreshes the memory information once and then returns:
adb shell Top-n 1
.Query the memory usage of each process:
adb shell Procrank
.Kill a process:
adb shell kill [PID]
.To view a list of processes:
adb Shell PS
.To view the status of a specified process:
adb shell ps-x [PID]
A .To view background services information:
adb shell Service list
.To view current memory consumption:
adb shell Cat/proc/meminfo
.To view the IO memory partition:
adb shell Cat/proc/iomem
.To re-mount the system partition as a read-write partition:
adb remount
.Copy files from local to device:
adb push <local> <remote>
.Copy files from device to Local:
adb pull <remote> <local>
.Lists the files and folders in the directory, equivalent to the dir command in DOS:
adb shell ls
.Enter the folder, equivalent to the CD command in DOS:
adb shell CD <folder>
.To rename a file:
adb shell rename Path/oldfilename path/newfilename
.Delete system/avi.apk:
adb shell rm/system/avi.apk
.Delete the folder and all the files below it:
adb shell rm-r <folder>
.To move a file:
adb shell mv Path/file newpath/file
.To set file permissions:
adb shell chmod 777/system/fonts/droidsansfallback.ttf
The PNs.New folder:
adb shell mkdir path/foldelname
.To view the contents of a file:
adb shell cat <file>
.To view WiFi password:
adb shell cat/data/misc/wifi/*.conf
.Clear the log cache:
adb logcat-c
.To view the bug report:
adb bugreport
A .Get Device Name:
adb shell Cat/system/build.prop
.View ADB help:
adb Help
.Run Monkey:
adb shell monkey-v-P Your.package.name
MORE:
how to get the Android device name (ADB command details)
Official Notes
Android adb command Daquan (view WiFi password, MAC address, device information, action file, view file, log information, uninstall, launch and install APK, etc. via ADB command)