embedded linux ,android

2010年11月2日 星期二

Android SDK Tools使用

這邊文章介紹幾個SDK tools

1. emulator
2. mksdcard
3. adb
4. DDMS

[root@localhost ~]# cd /home/online/android-sdk-linux_x86-1.6_r1/tools/
[root@localhost tools]# 
[root@localhost tools]# ls
adb         dmtracedump      hprof-conv  source.properties
android     draw9patch       lib         sqlite3
apkbuilder  emulator         mksdcard    traceview
ddms        hierarchyviewer  NOTICE.txt  zipalign
[root@localhost tools]# ./android list target
Available Android targets:
id: 1
     Name: Android 1.5
     Type: Platform
     API level: 3
     Revision: 1
     Skins: QVGA-P, HVGA (default), HVGA-L, HVGA-P, QVGA-L
id: 2
     Name: Android 1.6
     Type: Platform
     API level: 4
     Revision: 1
     Skins: HVGA (default), QVGA, WVGA800, WVGA854
id: 3
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 3
     Description: Android + Google APIs
     Based on Android 1.5 (API level 3)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: QVGA-P, HVGA-L, HVGA (default), QVGA-L, HVGA-P
id: 4
     Name: Google APIs
     Type: Add-On
     Vendor: Google Inc.
     Revision: 1
     Description: Android + Google APIs
     Based on Android 1.6 (API level 4)
     Libraries:
      * com.google.android.maps (maps.jar)
          API for Google Maps
     Skins: WVGA854, HVGA (default), WVGA800, QVGA
[root@localhost tools]#  ./android create avd --target 2 --name myavd
Android 1.6 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Created AVD 'myavd' based on Android 1.6, with the following hardware config:
hw.lcd.density=160
[root@localhost tools]#  mksdcard 512M mycard
[root@localhost tools]# ./emulator -avd myavd -skin HVGA -sdcard mycard &
[1] 4446
[root@localhost tools]# emulator: warning: opening audio output failed


[root@localhost tools]# ./android list avd
Available Android Virtual Devices:
    Name: sdk_1_6
    Path: /root/.android/avd/sdk_1_6.avd
  Target: Android 1.6 (API level 4)
    Skin: HVGA
  Sdcard: 32M
---------
    Name: avd16
    Path: /root/.android/avd/avd16.avd
  Target: Android 1.6 (API level 4)
    Skin: HVGA
---------
    Name: myavd
    Path: /root/.android/avd/myavd.avd
  Target: Android 1.6 (API level 4)
    Skin: HVGA
[root@localhost tools]# adb devices
List of devices attached 
emulator-5554   device

[root@localhost tools]# adb get-state
device
[root@localhost tools]# adb get-serialno
emulator-5554
[root@localhost tools]# #adb -s emulator-5554 install xxx.apk
[root@localhost tools]# #adb -s emulator-5554 uninstall com.example.xxx.xxx.apk
[root@localhost tools]# #adb shell
[root@localhost tools]# #adb pull <remote> <local>
[root@localhost tools]# #adb push <local> <remote>
[root@localhost tools]# #adb logcat
[root@localhost tools]# #adb bugreport
[root@localhost tools]# 
DDMS

沒有留言:

張貼留言