I needed to launch one of my Android emulators from the terminal recently and I was surprised to see how slow it was, especially seeing as I had enabled host GPU acceleration and that the emulator an x86 one with HAXM enabled. I had never experienced any such issues when starting the same emulator from my IDE. The exact error that I received was this:
emulator: ERROR: Could not load OpenGLES emulation library: dlopen(libOpenglRender.dylib, 1): image not found emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
I had a suspicion that this library may have been lurking in the SDK somewhere so I had a peek and discovered where it was hiding.
$ find $ANDROID_HOME -name 'libOpenglRender.dylib' /Applications/Android Studio.app/sdk/tools/lib/libOpenglRender.dylib
The solution was to append the SDK’s lib path to OS X’s LD_LIBRARY_PATH before invoking the emulator.
Naturally you can put this line in your shell’s startup script and you won’t have to worry about this problem again.