美文网首页
你要的ADB命令都在这里-(Android Debug Brid

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

作者: xiaoyuanhu | 来源:发表于2017-07-26 15:57 被阅读25次

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

相关文章

网友评论

      本文标题:你要的ADB命令都在这里-(Android Debug Brid

      本文链接:https://www.haomeiwen.com/subject/cmhokxtx.html