close
What is AVD ?

Android Virtual Devices (AVDs) are configurations of emulator options that let you better model an actual device.

可以處理
1. hardware features
像是鍵盤種類。

2. A mapping to a system image.

You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on.

3. 有關SD卡模擬

可以預先設好,跟AVD綁在一起。

4. Skin。

預設的四種(HVGA 直立 橫立 ... ),使用者也可以自己下載其他skin。


--

如何建立AVD呢?

就用sdk中 tool目錄下的android這個程式。

android -n yourname -t 1

這樣會產生一個名字叫做yourname的AVD,然後他的ID是1

-t (targetID)

ID要拿來做什麼呢?他並不是自選的編號,而是讓你選擇是那一種API,

一樣用sdk中 tool目錄下的android這個程式,下這個指令:

android list targets

會列出目前所有的 Available Android targets:

id:1

Name: Android 1.1
Type: platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P

id:2

Name: Android 1.5
Type: platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P

id:3

Name: Google APIs
Type: add-on
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L


詳細指令範例

http://developer.android.com/guide/developing/tools/avd.html


--

以下Joke :

之前亂試了一下 : android -n yourname -t 1

然後自以為 -t 只是一個自訂的編號,於是就發生了以下問題:

在pre-view sdk的嘗試中 加入了ADT9.0-pre後。
windows的eclipse可以成功compile但叫起來的模擬器會是1.1的 (即使已經指定成1.5) ,
但linux的ecipse無法成功compile ...

身為一個趕時間的人,我就在windows compile然後再將apk拿到linux上跑emulator ...

--

問題實際上是因為AVD指定成1 那當然就一直都是 1.1的模擬器阿 Orz

然後linux上的Eclipse ADT 我想可能是因為之前有自己建立的Eclipse plugin 需要先移除再重裝,晚點來試試看好了 Orz
arrow
arrow
    全站熱搜

    tttt 發表在 痞客邦 留言(1) 人氣()