Back

adb 基础 ,重点在 adb shell ( adb basic )

发布时间: 2015-04-11 06:10:00

refer to:  http://developer.android.com/tools/help/adb.html

adb : Android Debug Bridge. 

用来调试mobile phone的工具。

比如, 查看日志。 ^_^

使用之前,务必确保 android  启动了开发者模式

1. adb push/pull   (对于 huawei mate:  $ adb push xx.apk /storage/sdcard0  ,然后就可以手动打开手机的文件夹,根目录下就会发现apk文件了)

2. adb shell 

shell 的主要命令: logcat

1. logcat, 可以看到android中的输出。 这个非常重要,我们单独说:

2. dumpsys: dump system data

3. dumpstate: dump system state

4. dmsg  (debug kernel message) 

5. start/stop

active manager

/> am start -a android.intent.action.VIEW

package manager 

/>  pm install/uninstall com.example.MyApp

/> pm list packages com.happysoft  # => 列出所有包含 com.happysoft的package

录像

/> screenrecord /sdcard/demo.mp4

$ adb shell
shell@ $ screenrecord --verbose /sdcard/demo.mp4
(press Ctrl-C to stop)
shell@ $ exit
$ adb pull /sdcard/demo.mp4

ADB 也可以通过无线来连接。 具体略。

Back