adb 命令
参考链接
- http://developer.android.com/intl/zh-cn/tools/help/adb.html
- http://developer.android.com/intl/zh-cn/tools/help/shell.html
常用命令
Prints a list of all attached emulator/device instances.
1 | adb devices |
Pushes an Android application (specified as a full path to an .apk file) to an emulator/device.
1 | adb install <path-to-apk> |
Copies a specified file from an emulator/device instance to your development computer.
1 | adb pull <remote> <local> |
Copies a specified file from your development computer to an emulator/device instance.
1 | adb push <local> <remote> |
Checks whether the adb server process is running and starts it, if not.
1 | adb start-server |
Terminates the adb server process.
1 | adb kill-server |
Starts a remote shell in the target emulator/device instance.
1 | adb shell |
Issues a shell command in the target emulator/device instance and then exits the remote shell.
1 | adb shell [shellCommand] |
列出所有包名
1 | adb shell pm list packages |
清除数据
1 | adb shell pm clear <PACKAGE> |
截图
1 | adb shell screencap /sdcard/screen.png |
录屏
1 | adb shell screenrecord /sdcard/demo.mp4 |
读取数据相关命令
1 | run-as PACKAGE_NAME |