For our QA team we need to provide an Android emulator without Android Studio.To do this I used the line tools command provided by Google.
I made this folder tree
kit-emulator
-android-sdk
-avd
in the android-sdk subfolder I put the line tools command folder and from this folder using the sdkmanager I download the sdk with this command
sdkmanager --sdk_root=C:\Users\EBERTGU\Desktop\kit-emulator\android-sdk platform-tools emulator platforms;android-30 system-images;android-30;google_apis;x86_64
The download goes smoothly.
The avd folder is designed to accommodate the newly created emulator. For that I use the avdmanager of command line tools with the following command
avdmanager create avd -n "a350" -k "system-images;android-30;google_apis;x86_64" -p "C:\Users\EBERTGU\Desktop\kit-emulator\avd\a350" -f -d "pixel_4_xl"
The emulator is created in the a350 folder contained in the avd folder. You may be wondering what's wrong then. It's s the launch of the emulator.
When I start the emulator with the command emulator #350 I have this error
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Error which is explained by itself. So I set my environment variable ANDROID_SDK_ROOT to C:\Users\EBERTGU\Desktop\kit-emulator\android-sdk
I restart the commande line prompt and start again to start the emulator this time I got this error
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Users\EBERTGU\Desktop\kit-emulator\android-sdk]!
Now I don't understand why it doesn't work. I searched and opened the emulator ini file inside I found the line
image.sysdir.1=android-sdk\system-images\android-30\google_apis\x86_64\
In despair I changed it to
image.sysdir.1=C:\Users\EBERTGU\Desktop\kit-emulator\android-sdk\system-images\android-30\google_apis\x86_64\
And when I try to start the emulator with the modified image.sysdir.1 line it works !
Anyone have an explanation of why launching doesn't work with base value for image.sysdir.1 and environment variable?
Thank you a lot
Have a nice day
Shindra Guillaume
I found the solution, it was the generation of the emulator from the avdmanager in the bin folder of command tools lines. Just put the files at the root of command tools lines in a subfolder and the system image is properly configured to match that of the root SDK
I'm trying to install just the Android Emulator on my Mac, not the whole Android Studio.
So far I have:
1) Installed Android-SDK via Homebrew
brew cask install android-sdk
2) Added to my $PATH, and checked I have no other ANDROID related PATHS going on.
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
3) In terminal running
$ANDROID_SDK_ROOT
shows
/usr/local/share/android-sdk: is a directory
4) Created a new AVD in with AVDManager.
5) Try to run created AVD and get this error
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/usr/local/share/android-sdk]!
I also can't run 'emulator' from the command line, I CAN run avdmanager and sdkmanager fine.
I've checked the path which appears to be correct. The AVD is in the location of
/Users/<user>/.android/avd/test.avd
Where could I be going wrong?
I had the same issue on Linux, trying to build a Docker image for the emulator, and finally find out what the reason was by looking at the Android emulator source code.
I installed only the required SDK packages for emulator ("emulator" and one of the "system-images"), but the emulator program check if ANDROID_HOME or ANDROID_SDK_ROOT path contains the "platforms" and "platform-tools" directory, so I installed the "platform-tools" package and one of the "platforms" package and it worked.
Manually create those two empty directories should also be enough.
I run a build on a ubuntu 16.04 server with no xorg or GUI of any kind, and I am trying to run a simulator on it. this is what I get on the console
$ /opt/android//tools/emulator -engine classic -ports 5688,5689 -report-console tcp:5815,max=60 -avd Nexus_5X_API_25 -no-snapshot-load -no-snapshot-save -no-window
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT
Build was aborted
How do I set the ANDROID_SDK_ROOT in ubuntu?
export ANDROID_SDK_ROOT=/usr/lib/android-sdk in your ~/.bashrc or /etc/profile
I have Ubuntu 20.04, and for me the path is /root/Android/Sdk.
export ANDROID_SDK_ROOT=/root/Android/Sdk
Type in terminal,
echo $ANDROID_SDK_ROOT
this command will display ANDROID_SDK_ROOT variable path.
IF NOTHING APPEARS THEN SET IT WITH THIS
export ANDROID_SDK_ROOT = yourandroidsdkpath
For displaying follow first command.
You can refer in this topic
I am trying to run android emulator on my linux headless machine. I install android sdk, required platofrms and so on. I already created android avd using following command
android create avd -n TestDevice4.4.2 -t 17 ( 17 is id of from targets list )
Now i try to start emulator by following command
emulator -avd TestDevice4.4.2 -no-skin -no-window
And i got the following error on my terminal.
/home/ubuntu/sdk-android/tools/emulator64-arm: error while loading
shared libraries: libGL.so.1: cannot open shared object file: No such
file or directory
Since it is the first time setting up from termial in headless linux machine, i faced several issues. I can't figure out what's going on with this one. Appreciate your help :-)
EDITED
I've seen similar issues here. I had to install following library and create symbolink in sdk/tools/lib dir.
sudo apt-get install libgl1-mesa-dev
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 libGL.so
After done these steps, i start emulator again. i got following problem :-(
sh: 1: glxinfo: not found emulator:
ERROR: This AVD's configuration is
missing a kernel file!! emulator: ERROR: ANDROID_SDK_ROOT is undefined
For each version of Android you want to run, install at least:
1) Platform SDK (eg 17 for 4.2 version)
2) A system image for the emulator (eg ARM EABI v7a System Image )
bye
I have installed Eclipse 4.2 with Eclipse android plugin(ADT)on ubuntu 11.10. when i launch "Hello World" project as an android application, it simply wont launch!
ps -x > log.txt after launching the emulator, output:
1000 7221 20.0 0.6 16884 6908 ? D 18:11 0:00 /home/tutakhail/android-sdks/tools/emulator-arm -avd AndroidBrowser -netspeed full -netdelay none
launching the emulator manually from shell, i get the following error, shortly after which the emulator launches but is very slow.
emulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object file: No such file or directory
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
Any hints on what could be the issue here? Perhaps related to Ubuntu?
Turns out the solution is to point LD_LIBRARY_PATH to the /tools/lib path.
Below works for me.
➜ tools file ../tools/lib/libOpenglRender.so
../tools/lib/libOpenglRender.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
➜ tools export LD_LIBRARY_PATH=/home/xxxx/devel/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH
➜ tools ./emulator-x86 -avd AtomX86 -gpu on -qemu -m 1024 -enable-kvm
emulator: emulator window was out of view and was recentered
....
I guess its a bug affecting the latest versions of the ADTs perhaps has something to do with NVIDIA GPUs drivers. The issue is discussed here:
https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc
The work around that I have found which at least lets me execute my applications till a permanent solution is released, is that by first launching the emulator from shell even if it throws the error. After which i right-click and run my projects as an "Android application". The emulator does surprisingly execute them!
I've got similar error, and I guess this error caused by missing libGL.so.
Install package libgl1-mesa-dev;
sudo apt-get install libgl1-mesa-dev
Source
Try running emulator from command line first to see if everything goes well.
You may need to add options like:
-no-audio
-gpu off
I've seen audio preventing emulator to start on some Ubuntu configurations.
I tried to use the Intel Hardware Acceleration in Ubuntu 12.04 for running emulators using KVM package. However I was getting the error, "Failed to start RenderThread". Installing the package libgl1-mesa-dev and reducing the Device RAM Size to 512 solved my problem. The emulator now is indeed atleast 10X faster. I hope this would help someone trying to emulate android devices in Ubuntu using Intel processor that supports Virtualizattion Technology.
SO i guess maybe you haven't installed everything properly.
You should check if you followed the steps as shown in :
http://www.wikihow.com/Install-Android-on-Ubuntu-Linux-With-Eclipse-Ide
After installing it properly and setting up the PATH environment variables .
Also another thing you can do is try deleting the AVD emulator and creating a new one and then try again .
Also i found your question over here at : https://groups.google.com/forum/?fromgroups#!topic/adt-dev/nlA07toW1fc
THe question you asked is not really specific so just try following the steps.
The following command saved my life with the same problem
sudo apt-get install libgl1-mesa-dev
If using eclipse, you have to add in Project-Properties in the "Java Build Path" -> Libraries -> Android 4.4 -> "Native library location" the path to sdk/tools/lib directory.
For me this is "install-dir-of-sdk"/sdk/tools/lib"
Configure ANDROID_HOME
export ANDROID_HOME=//android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
and set LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH"
To run ARM version
cd $ANDROID_HOME/emulator/
./emulator64-arm -avd Nexus_5X_ARM_22 -no-audio -gpu off
I solved this on my Red Hat Linux 64 bit by installing the 32bit libGL (it should be located in /usr/lib/)
sudo yum install mesa-libGL.i686
libOpenglRender.so and other necessary files are present, indeed, in tools/lib64, while avd tries to find them in tools/lib
Making symbolic links to the files and dirs helped (in my case)
ln -s ../lib64/qt qt
ln -s ../lib64/gles_mesa gles_mesa
ln -s ../lib64/libstdc++ libstdc++
ln -s ../lib64/lib64GLES_V2_translator.so lib64GLES_V2_translator.so
ln -s ../lib64/lib64emugl_test_shared_library.so lib64emugl_test_shared_library.so
ln -s ../lib64/lib64OpenglRender.so lib64OpenglRender.so
ln -s ../lib64/lib64GLES_CM_translator.so lib64GLES_CM_translator.so
ln -s ../lib64/lib64EGL_translator.so lib64EGL_translator.so
(seems to be bug in original config, as that happens with fresh install of the studio/sdk)