Paul - The Programmer

simple & stupid
Setup Android dev environment on Debian X86_64

Fix unknown virtual device error for launching android emulator

paul posted @ Wed, 06 Apr 2011 12:30:39 +0800 in android with tags android android sdk , 3499 readers

The problem is after the avd be created successfully, the emulator.exe launching ends up by error 'unknown virtual device name: your-avd-name'. 

I think this error is caused by I moved my Documents folder to "D:\paul\My Docuements". The android.bat tool created the avd files under "D:\paul\.android". But, by default, the emulator tries to load the avd files from "%USERPROFILE%\.android". In my system, it is "C:\Documents and Settings\paul".  

The emulator.exe and android.bat have different logic to caculate the avd files path. One explanation is the emulator is a C app and the android.bat tool is actually a Java based app. 

To solve this problem, the best solution is to define the global environment variable "ANDROID_SDK_HOME".

The value of the "ANDROID_SDK_HOME" is the parent directory path where you want the .android to be created.

e.g.  set ANDROID_SDK_HOME="d:\"

Then the path to .android is d:\.android.

The emulator now can load the virtual device setting properly from d:\.android

 

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter