Update Your Path For The New Android Emulator Location
Since March 2017 (v25.3.0), the Android Emulator has been released separately from the rest of the Android SDK tools. As part of implementing this change, the emulator
binary was ‘promoted’ from ${ANDROID_SDK_ROOT}/tools/
1 to its own top-level directory, ${ANDROID_SDK_ROOT}/emulator/
. This relocation can cause some issues. I’ll show you how to avoid them.
At the time of the change, it was indicated that old versions of Android Studio should be unaffected. However, I recently needed to launch the emulator from the command line to test customized Android system images, and in doing so discovered some rough edges:
If I run this same command using the relocated emulator
, the AVD launches successfully:
This is despite the fact that
and
both report the same version information:
I’m guessing the error is due to a discrepency in the emulator-related files found in each location:
I’m not sure why this discrepancy exists.
If, like me, all you care about is having easy command-line access to the newest emulator
binary, I recommend updating your $PATH
to include
Make sure this appears before2 any existing reference to
in your $PATH
so that the correct emulator
binary is prioritized:
Happy emulating!
-
In writing this post I also discovered for the first time that
${ANDROID_HOME}
has been deprecated in favor of${ANDROID_SDK_ROOT}
. Read more in the Android Studio User Guide section on Environment Variables. ↩ -
Run
echo $PATH
to check the full contents of your$PATH
variable. Searched paths are separated by a colon and searched first-to-last. ↩