Android’s envsetup.sh and the emulator AVD error

After building Android, typing  emulator at the command line will cause the recently-built AVD to run in the build’s emulator. This happens seamlessly because the build process adds <ANDROID BASEDIR>/out/host/linux-x86/bin/emulator to the PATH. The build process also sets the ANDROID_PRODUCT_OUT environment variable, which points to the directory containing the disk images that comprise your new AVD.

After restarting the computer,  emulator will no longer be in the path, and when you try to run  <ANDROID BASEDIR>/out/host/linux-x86/bin/emulator, it produces the an error:

To fix this, you can explicitly set ANDROID_PRODUCT_OUT to point to your disk image directory by typing

before running the build or Android SDK emulator.

The easier fix for “emulator: ERROR: You did not specify a virtual device name”

If it works for you, you can run  build/envsetup.sh and then setpaths, which will set up the environmental variables automatically, fixing the “emulator: ERROR: You did not specify a virtual device name” issue.

In addition to setpaths and lunch, envsetup.sh provides a few other handy commands that make development easier:

If setpaths doesn’t fix the “emulator: ERROR: You did not specify a virtual device name” problem, try manually exporting ANDROID_PRODUCT_OUT.

 

Incoming search terms:

One thought on “Android’s envsetup.sh and the emulator AVD error

  1. Pingback: No emulator after building Android kernel : Android Community - For Application Development

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">