View the simulator type
1. Add the tools directory in the Android-SDK to the system directory (that is, the path in the environment variable)
$ Android list targets
Available Android targets:
ID: 1 or "Android-3"
Name: IOS 1.5
Type: Platform
API level: 3
Revision: 4
Skins: hvga (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
ID: 2 or "Google Inc.: Google APIs: 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: 3 or "Android-4"
Name: IOS 1.6
Type: Platform
API level: 4
Revision: 3
Skins: hvga (default), qvga, wvga800, wvga854
ID: 4 or "Google Inc.: Google APIs: 4"
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Revision: 2
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
ID: 5 or "Android-7"
Name: Android 2.1-update1
Type: Platform
API level: 7
Revision: 2
Skins: hvga (default), qvga, wqvga400, wqvga432, wvga800, wvga854
ID: 6 or "Google Inc.: Google APIs: 7"
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 2.1-update1 (API level 7)
Libraries:
* COM. Google. Android. Maps (maps. Jar)
API for Google Maps
Skins: wvga854, wqvga400, hvga (default), wqvga432, wvga800, qvga
ID: 7 or "Android-8"
Name: IOS 2.2
Type: Platform
API level: 8
Revision: 2
Skins: hvga (default), qvga, wqvga400, wqvga432, wvga800, wvga854
ID: 8 or "Google Inc.: Google APIs: 8"
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 2.2 (API Level 8)
Libraries:
* COM. Google. Android. Maps (maps. Jar)
API for Google Maps
Skins: wvga854, wqvga400, hvga (default), wqvga432, wvga800, qvga
The four Android simulators and the corresponding four 'Google APIs 'are listed here. Google Maps its own applications in the Google APIs simulator type, therefore, to develop Google maps and other Google-specific applications, a corresponding Google APIs simulator must be created.
Create a simulator
To enable Android applications to run on simulators, you must create a simulator () AVD.
(1) Create AVD in eclipse
• In eclipse. Choose Windows> Android SDK and AVD manager]
• Click virtual devices in the left-side pane and click New on the right]
• Enter the device name and select the target API. the SD card size is smaller than 9 MB, and the skin value is optional. Currently, the default value of hardware is used.
• Click Create AVD to create an AVD.
(2) create AVD through the command line
Create an Android-7 Simulator
$ Android create AVD -- Target 5 -- name android7cpu
[Android create AVD]Create a simulator
[-- Target 5]The simulator uses the simulator type with ID 5.
[-- Name android7cpu]Name the simulator "android7cpu"
Result:
Android 2.1-update1 is a basic Android platform.
Do you wish to create a custom hardware profile [No]
Created AVD 'android7cpu 'based on Android 2.1-update1,
With the following hardware config:
HW. LCD. density = 160
Check the existing simulator:
$ Android list AVD
Result:
List existing AVD
Available Android Virtual Devices:
Name: android7cpu
Path: C:/Documents and Settings/Administrator/. Android/AVD/android7cpu. AV
Target: Android 2.1-update1 (API level 7)
Skin: hvga
---------
Name: mydevice
Path: C:/Documents and Settings/Administrator/. Android/AVD/mydevice. AVD
Target: Android 2.2 (API Level 8)
Skin: hvga
Sdcard: 9 m
Set AVD environment parameters:
Enable eclipse [run]> [debug deployments...] and then select Android Project (helloword) under [Android Application] In the list on the left ).
On the "android" tab on the right, you can select a project and the "launch action" tab are default lunch default activity.
[Target] Tab
In deployment target selection mode, select automatic and select AVD in the list below, and view AVD details.
Emulator launch parameters
Switch AVD Screen
During running, CTRL + F12 switches to the horizontal and vertical display of AVD.
Set AVD settings
Skins: hvga (default), qvga, wqvga400, wqvga432, wvga800, wvga854
The default value is hvga. You can add the -- skin qvga-L option after creating the AVD command line to set it to qvga, "-L" indicates (landscape) "-P"
Portrait)
Delete programs in AVD
Android SDK provides the ADB (Android debugger) command line tool (requires root permission to run)
Start ADB
¥ ADB Shell
Switch to the data/APP directory
¥ CD Data/APP
View list
$ Ls (Linux)
¥ Dir (Windows)
Rm command to delete a program
$ RM xxx.apk
Delete AVD
$ Android Delete AVD -- name avdname