One: What is ADB
ADB, called the Android Debug Bridge, it is Android developers / testers irreplaceable powerful tool.
Two: Step
- detecting whether the installation ADB
adb version
- If you do not install:
brew cask install android-platform-tools
- data cable to connect your phone to the computer, select USB debugging, to detect whether the phone is connected successfully
adb devices
- Install Apk to your phone
cd path/path
adb install demo.apk
Three: ADB commonly used commands
- View ADB version: adb version
- view the phone device: adb devices
- View the device model: adb shell getprop ro.product.model
- View battery information: adb shell dumpsys battery
- View Device ID: adb shell settings get secure android_id
- View Device IMEI: adb shell dumpsys iphonesubinfo
- View Android version: adb shell getprop ro.build.version.release
- Check the phone network information: adb shell ifconfig
- View device logs: adb logcat
- restart the phone device: adb reboot
- Install a apk: adb install /path/demo.apk
- Uninstall a apk: adb uninstall <package>
- check the system process: adb shell ps
- Check system disk situation: adb shell ls / path /
- Mobile equipment screenshots: adb shell screencap -p /sdcard/aa.png
Four: ADB phone can not be detected
- Obtain the appropriate vendor Vender ID
system_profiler SPUSBDataType
- Vender ID will be written to the file
vi /Users/xxx/.android/adb_usb.ini
- ADB server restart process
adb kill-server
adb start-server
- Get the device again
adb devices