Launching the Android Emulator from the Command Line

I’m not sure which update exactly broke it, but recently I got this when trying to launch the Android Emulator from the CLI:

$ emulator -list-avds
Nexus_5X_API_25

$ emulator -avd Nexus_5X_API_25
[140735953220544]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '../emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory

Apparently there’s some relative path linking happening, which of course fails when running the emulator command from a project directory.

The fix is to run the emulator command from the directory in which it resides. Some command combinations later, this is the result (with Nexus_5X_API_25 being the name of the created virtual device):

cd $(dirname $(which emulator)) && ./emulator -avd Nexus_5X_API_25
Elsewhere ,

4 Responses to Launching the Android Emulator from the Command Line

  1. Pingback: Fix for the Android Emulator crashing during launch | Bram.us

  2. This bug should be fixed in the next update of the build tools: https://issuetracker.google.com/issues/37137213

Leave a Reply

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