Create AVD and sdcard in Android

Source: Internet
Author: User

1. Create AVD
In Android SDK 1.5
In development after version, at least one AVD must be created, and each AVD simulates a set of virtual devices to run Android applications. Program . Whether you create a new AVD under eclipse or command line, the system automatically creates a. Android
Folder. The created AVD configuration information is saved in the. 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 "whether to customize your own device". The default option is "no". If you enter
"Y", then you can customize the simulator performance parameters as prompted.
Here t represents the API level of the target platform. We can use the 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. Enter "name", select the target API, and select "SD ".
Card is of any size and skin is selected as needed. Currently, hardware retains the default value.
4. Click Create
AVD can be created.
Note: If you click virtual devices on the left panel, click New on the right.
When the target drop-down list does not have any option, click available packages on the left panel and select

Https://dl-ssl.google.com/android/repository/repository.xml,
Then click Install
Select button, and then follow the prompts.

2. Create an sdcard Image File
Go to Android
In the tools subdirectory of the SDK directory, 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 on the command line
go to the tools subdirectory under the android
SDK directory, run
emulator-AVD myavd-sdcard
android. IMG
if you do not want to add-sdcard $ sdcard_path every time, there are two solutions
solution 1: You can set sdcard. IMG
copy to c: \ Documents ents and
Settings \ Administrator \.
solution 2: modify the configuration file, c: \ Documents 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 to "C: \ Documents ents and
Under Settings \ Administrator \. Android. There are two ways to change the AVD path settings
Solution 1:

Add an environment variable named
"Android_sdk_home", and then 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
The myavd. ini file in the Settings \ Administrator \. Android \ AVD directory, find

Target = android-5path
= C: \ Documents ents and
Settings \ Administrator \. Android \ AVD \ myavd. AVD
Modify the path.

If an error occurs:
Unknown Virtual Device name is generally caused by an AVD file path reference error.

 

 

========================================

========================================

========================================

 

After installing the android environment in eclipse, you can directly create AVD and sdcard, Windows> Android SDK and AVD manager, and create sdcard at the same time when creating an AVD. The following describes how to create these things using command lines.

 

1. Create AVD

 

1. Configure the environment variables and add the simulator path to the path, as shown in figure

 

D: android-sdk_r06-windowsandroid-sdk-windows ools;

 

2. Open the command line (shortcut: Win + r) and Enter cmd;

 

3. list all platforms: Android list target or android list targets

 

4. Create AVD: Android create AVD? -Name -- target where your AVD name is your own AVD name, And targetid is the platform ID listed above

 

Or Android create AVD? -N-t (note that the preceding is -- if it is not abbreviated --);

 

5. Check whether AVD is created successfully: Command: Android list AVD

 

6. Start the simulator: Command: emulator-AVD (your AVD name)

 

Ii. Create an sdcard

 

1. mksdcard 1024 m d: androidsdcard. IMG the first parameter is the size of the created sdcard, and the second parameter is the path and name of the sdcard. We recommend that you use the IMG suffix. (Note that no space is allowed in the path.) It may take about 30 seconds to create an sdcard. Please wait;

 

2. Import the newly created SD card to the simulator: emulator-AVD-sdcard D: androidsdcard. IMG. After the import, the simulator starts automatically;

 

3. In eclipse, you can view the information in sdcard, Windows> show views-other-file explorer.

 

Related Article

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.