adb shell setprop persist.sys.root_access 3
adb root
adb remount
adb shell
sudo apt-get install android-tools-adb
mkdir -p ~/.android
vi ~/.android/adb_usb.ini
# Add the following line
0x2207
sudo vi /etc/udev/rules.d/51-android.rules
# Add the following line
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666"
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo adb kill-server
adb start-server
adb shell setprop persist.sys.root_access 3
adb root
adb remount
adb shell
1.Check the connected devices:
adb devices #Note: offline in the returned information means that the device is not connected successfully or has no response, and device is connected
2.Get device serial number:
adb get-serialno
3.Specify the connected device using the command:
adb -s cf27456f shell #Note: cf27456f here is the device serial number, you can query the corresponding serial number through adb devices
4.Check the device model:
adb shell getprop ro.product.model
5.Check bug reports:
adb bugreport
6.Check the adb version information:
adb version
7.Check screen resolution:
adb shell wm size
8.Check screen density:
adb shell wm density
9.Istall app:
adb install test.apk
10.Install apk to sd card:
adb install -r demo.apk
11.To uninstall an application, you need to specify the package:
adb uninstall cn.com.test.mobile
12.Uninstall app but keep data and cache files:
adb shell cmd package uninstall -k cn.com.test.mobil
13.List the package names of all installed apps:
adb shell pm list packages
14.List all package names of system applications:
adb shell pm list packages -s
15.List third-party application package names other than system applications:
adb shell pm list packages -3
16.Windows lists packages with tests:
adb shell pm list packages | find "test"
17.Clear application data and cache:
adb shell pm clear cn.com.test.mobile
18.Start the application:
adb shell am start -ncn.com.test.mobile/.ui.SplashActivity
19.Package information:
adb shell dumpsys package
20.Memory usage:
adb shell dumpsys meminfo
21.Force stop the app:
adb shell am force-stop cn.com.test.mobile
22.View logs:
adb logcat
23.clear log cache:
adb logcat -c
24.reboot:
adb reboot
25.Check the Android system version:
adb shell getprop ro.build.version.release
26.View the top 10 apps that occupy memory:
adb shell top -s 10
27.Copy files from local to device:
adb push <local> <remote>
28.Copy files from device to local:
adb pull <remote> <local>
29.View ADB help:
adb help
30.Obtain the MAC address, the parameters may be different according to the system version:
adb shell cat /sys/class/net/wlan0/address
31.Check out the running Services:
adb shell dumpsys activity services [<packagename>]
* Note: The <packagename> parameter is not required. Specifying <packagename> means viewing Services related to a certain package name, and not specifying means viewing all Services.
* Note: <packagename> does not have to give a complete package name, for example, run adb shell dumpsys activity services org.zhihu, then the package names org.zhihu.demo1, org.zhihu.demo2 and org.zhihu and other related Services will be listed come out.