你要的ADB命令都在这里-(Android Debug Brid

2017-07-26  本文已影响25人  xiaoyuanhu

1.基本命令

查看adb连接的设备  adb devices -l

杀adb进程  adb kill-server

启动adb进程  adb start-server

指定设备  $ adb -s emulator-5555 install helloWorld.apk

2.电脑和手机文件的拉取/推送

adb pull remote local

adb push local remote

push整个文件夹 adb push xxx/.  xxx/

3.安装和卸载

4.查看手机上的日志 


5.adb重启/root/remount/脚本


adb shell脚本命令

1.adb shell am(ActivityManager)

启动Activity :

adb shell am start -n com.android.example/.MainActivity

adb shell am start -a android.intent.action.VIEW

杀进程        adb shell am force-stop com.android.example

2.pm(PackageManager)

查看手机已安装apk    adb shell pm list packages -3

清除app数据    adb shell pm clear com.android.example

3.打印手机信息 adb shell dumpsys:

打印当前activity堆栈 adb shell dumpsys activity

参考资料:https://developer.android.com/studio/command-line/adb.html

上一篇 下一篇

猜你喜欢

热点阅读