AVD and image files in Android

Source: Internet
Author: User

1. Create AVD
In development after android sdk 1.5, at least one AVD must be created. Each AVD simulates a virtual device to run Android applications. Whether you create a new avd under eclipse or command line, the system automatically creates one under the default file path of the system. android folder. The created avd configuration information is saved in this directory. android directory, for example:
C: \ Documents ents and Settings \ Administrator \. android

1) Create AVD using command line
Command Format: android create avd-n [avd name]-t [api level]
Go to the tools subdirectory under the Android SDK directory and run:
: Android create avd-name adk_rj5_version -- target 2
In step 2 of creating the avd file, the console prompts "Do You Want to customize your own device". The default option is "no". If you enter "y", follow the prompts step by step, customize your own simulator performance parameters.
Here t represents the API Level of the target platform. We can use android list targets to view the optional t parameters,
Go to the tools subdirectory under the Android SDK directory and run: android list targets

2) Develop tools to create AVD
1. In Eclipse. Choose Windows> Android SDK and AVD Manager
2. Click Virtual Devices in the left-side pane, and then click New on the right side.
3. Fill in the Name and select the Target API. the SD Card is of any size and the Skin option is selected. Currently, the default value of Hardware is used.
4. Click Create AVD to Create an AVD.
Note: If you click Virtual Devices in the left-side pane and New in the right-side pane, but the target drop-down list does not have any options, click Available Packages in the left-side pane and select
Https://dl-ssl.google.com/android/repository/repository.xml,
Click the Install Selected button and then follow the prompts.

2. Create an SDCard Image File
Go to the tools subdirectory under the Android SDK directory and run
Mksdcard-l sdcard 512 M e: \ sdcard. img
In this way, a m SD card image file is created: view the edisk, and an sdcard. img file is created under the edisk.

3. Load sdcard when running AVD in the command line
Go to the tools subdirectory under the Android SDK directory and run
Emulator-avd MyAVD-sdcard android. img
If you do not want to add-sdcard $ sdcard_path every time, there are two methods:
Solution 1: Copy sdcard. img to the avd directory under C: \ Documents and Settings \ Administrator \. android \ AVD \.
Solution 2: modify the configuration file C: \ Documents ents and Settings \ Administrator \. android \ avd \ AVD_NAME.avd \, open config. ini, add the following lines: sdcard. path = Your SD card path

4. AVD path settings
As mentioned above, no matter whether you use Eclipse or create an Android Emulator from the command line, the corresponding file is placed under "C: \ Documents ents and Settings \ Administrator \. android. There are two ways to change the AVD path settings
Solution 1:
Add an environment variable named "ANDROID_SDK_HOME" and change the variable value to the location where you want to place the ". android" folder (AVD information ).
Solution 2:
Modify the path in the configuration file. For example, if my AVD name is MyAVD, open
C: \ Documents ents and Settings \ Administrator \. android \ avd directory file MyAVD. ini, find
Target = android-5path
= C: \ Documents ents and Settings \ Administrator \. android \ avd \ MyAVD. avd
Modify the path.
If an ERROR such as ERROR: unknown virtual device name is encountered, it is generally caused by an AVD file path reference ERROR.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.