记录一些常用的Adb命令,以及一些常见的错误。
常用命令
1、查看栈顶Activity :
2、通过命令行打开Activity界面 :
例如:
3、adb启动service:
4、adb发送broadcast:
5、模拟器真机同时存在的情况下,安装Apk:
6、查看App启动消耗时间
You can also measure the time to initial display by running your app with the ADB Shell Activity Manager command. Here’s an example:
The Displayed metric appears in the logcat output as before. Your terminal window should also display the following:
The -c and -a arguments are optional and let you specify category and action for the intent.
7、查看进程启动
过滤关键字: start proc
8、过滤Android异常
Adb Error相关
1、使用Genymotion遇到错误:
反反复复的 adb kill-server –> start-server,还是同样的错误。
原因:genymotion的adb设置。
解决方案如下:
Adb相关资料
Adb官网教程:https://developer.android.com/studio/command-line/adb.html#shellcommands
官网性能优化教程:https://developer.android.com/topic/performance/launch-time.html
《Android ADB命令?这一次我再也不死记了!》:http://mp.weixin.qq.com/s/fWaa1rutwfoIIrje8RfWBw
adb logcat 命令行用法:http://blog.csdn.net/tumuzhuanjia/article/details/39555445