AVD usage and error handling methods in Android

Source: Internet
Author: User

After setting environment variables, emulator of Version 1.1 can be started by entering emulator in the command line. However, in version 1.5, an AVD (Android Virtual Device) is added ), AVD is equivalent to a simulator, but you can use AVD to create Simulators Based on different versions, and then use the emulator-AVD avdname command to start different simulators. The following describes how to create AVD:

1. view the currently supported versions (we need to remember the id value in the listed versions. This value is used in step 1 ):

Android list targets

2. Create AVD (the last 2 indicates creating AVD of version 1.5 ):

Android create AVD-N avdname-T 2

3. Check whether the creation is successful (if the creation is successful, the AVD information we just created will be displayed ):

Android list AVD

4. Start the simulator:

Emulator-AVD avdname

5. Select the start skin (horizontal simulator)

Emulator-AVD avdname-skin HVGA-L

6. Press Ctrl + F11 to directly change the horizontal and vertical placement of the simulator.

7. The actual AVD creation process and Error Handling Methods

First create an AVD and use the command line method to create it. For example:

D:/Android/android-sdk-windows-1.5_r3/tools> Android create AVD-N avd15-T 2

The android 1.5 is a basic Android platform.

Do you wish to create a custom hardware profile [No]

Created AVD 'avd15' Based on Android 1.5

Use the android list AVD command to list the current AVD:

D:/Android/android-sdk-windows-1.5_r3/tools> Android list AVD

Available Android Virtual Devices:

Name: avd15

Path: D:/My Documents/. Android/AVD/avd15.avd

Target: Android 1.5 (API level 3)

Skin: hvga

Pay attention to the AVD directory above, put /. copy the android folder to C:/Documents and Settings/administrator. Because I use administrator to log on, copy it to this directory and copy it to the corresponding C: /Documents and Settings/Under the user name, note that the user name must be an English name.

If emluator-AVD avd15 is used, the following error is returned:

Emulator: Error: No search paths found in this AVD's configuration.

Weird, the AVD's config. ini file is malformed. Try re-creating it.

The cause of this error is C:/Documents ents and settings/Administrator /. the INI file in the android/AVD directory contains Chinese characters-my documents, so you need to modify this INI file-avd15.ini and change path to Path = C:/Documents and Settings/Administrator /. android/AVD/avd15.avd.

At this time, you can start emulator:

D:/Android/android-sdk-windows-1.5_r3/tools> emulator-AVD avd15

Emulator: emulator window was out of view and was recentred

You can see the Google Android simulator.

Run the project in eclipse and select andorid project. The Android AVD error dialog box is displayed. Select Yes,

Then Android Virtual Device Manager is displayed:

Click Finish and the Android device chooser dialog box is displayed:

The currently running emulator is displayed, select it, and OK.

In this case, the project application can be displayed in emulator.Program.

Summary:

Start emulator and then run the project in eclipse.

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.