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

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容