ADB common commands

Enter the specified device adb -s serialNumber shell
to view the version adb version
view the log adb logcat
view the device adb devices
connection status adb get-state
start the ADB service adb start-server
stop the ADB service adb kill-server
computer push to mobile phone adb push local remote
mobile phone pull Get the computer adb pull remote loca
to restart the machine adb reboot
get the serial number adb get-serialno
restart to bootloader, that is, flash mode adb reboot bootloader
restart to recovery, that is recovery mode adb reboot recovery
install APK: adb install <apkfile> //For example: adb install 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
to get the machine MAC address adb shell cat /sys/class/net/wlan0/address
Start the application: adb shell am start -n <package_name>/.<activity_class_name> For example: adb shell am start -n yf.o2o.store/yf.o2o.store.activity.LoginActivity
to view the occupied memory sort adb shell top
to view the occupied memory The first 6 apps: adb shell top -m 6
Refresh the memory information once, and then return: adb shell top -n 1
Query the memory usage of each process: adb shell procrank
Clear application cache and data: adb shell pm clear "package name"
kill To kill a process: adb shell kill [pid]
to view the process list: adb shell ps
to view the status of the specified process: adb shell ps -x [PID]
to view background services information: adb shell service list
to view the current memory usage: adb shell cat /proc/ meminfo
View IO memory partitions: adb shell cat /proc/iomem
Remount the system partition as a readable and writable 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, which is equivalent to the dir command in dos: adb shell ls
Enter the folder, which is equivalent to the cd command in dos: adb shell cd <folder>
Rename the 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: adb shell rm -r <folder>
Move files: adb shell mv path/file newpath/file
Set file permissions: adb shell chmod 777 /system/fonts/DroidSansFallback.ttf
New folder: adb shell mkdir path /foldelname
View file content: adb shell cat <file>
View wifi password: adb shell cat /data/misc/wifi/*.conf
Clear log cache: adb logcat -c
View bug report: adb bugreport
Get device name: adb shell cat /system/build.prop
View ADB help: adb help
Run monkey:
adb shell monkey -v -p  your.package.name  500
adb -s 192.168.244.151:5555 shell monkey -v -p com.bolexim 500

Guess you like

Origin blog.csdn.net/weixin_42081020/article/details/128618981