adb(AndroidDebugBridge)是Android提供的一个通用调试工具,借助这个工具,可以管理设备或手机模拟器的状态。
1 adb 常用操作:
安装应用到模拟器
adb install app.apk
查看Bug报告
adb bugreport
记录无线通讯日志
无线通讯记录日志非常多,在运行时没必要记录,可以通过命令设置记录
adb shell
logcat -b radio
2 Android没有提供一个卸载应用的命令,只能手动删除:
adb shell
cd data/app
rm app.apk
3 进入设备或模拟器的shell:
adb shell
通过以上命令,可以进入设备或模拟器的shell环境中,在这个LinuxShell中,你可以执行各种Linux的命令,
启动应用 如打开chrome
adb shell am start -n com.android.chrome/com.android.chrome.Main
adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
停止应用/Kill 应用
adb shell am force-stop com.android.chrome
参考:https://github.com/Polymer/tools/blob/master/bin/adb-chrome.sh
http://stackoverflow.com/questions/28150650/open-chrome-with-adb