2010年9月10日 星期五

android adb command

1. 偵測裝置
adb devices
PS. 如果在type "adb devices"後出現device offline,有可能是低電壓.也可嘗試type "adb kill-server XXXXXX",再重新type "adb devices".
2. 安裝檔案
adb install -r F:\aaa.apk
3. 取得手機資訊
adb getprop
PS.這是未出廠手機可以使用.
4. copy file to device
adb push f:\led_control.so /system/lib/led_control.so
5. 刪除檔案
adb shell rm -r /system/sd/app
6. 取得BT資料
    1) adb shell
    2) hcitool
7. 取得wifi, power, connectivity...
    svc wifi [enable | disable]
    svc wifi prefer (set wifi as the preferred data network)
    svc power [ ]
    svc data [ ]
    svc help
8. 同時看adb logcat並同時存下logcat
    adb logcat | tee logcat.txt
9. Run CTS test
start --planCTS -P android.security.cts.package in [ \build\core\Makefile.in$(PACKAGE)]
如果要測細項.
10. Launcher application
      adb shell am start -n packagename/.Intent
      ex: adb shell am start -n com.example/.Welcome