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
Related
I have installed the command line tools of android, correctly configured all environment variables.
When I am creating a virtual device with this command:
avdmanager create avd -n test -k "system-images;android-23;google_apis;x86"
It gives the following error:
error: package path is not valid. valid system image paths are:ository... null
I have already installed the SDK tool : sdkmanager "system-images;android-23;google_apis;x86"
And accepted the licenses sdkmanager --licenses
But still it's showing the same error.
By the way, I am using it for react-native
In order to resolve your issue, you need to first run the cmd sdkmanager --list. A list will be populated with installed & available modules make sure: you have installed
Build-tools sdkmanager build-tools 30
Platform-tools sdkmanager platform 30
System image sdkmanager "system-images;android-30;google_apis;x86"
System image sdkmanager "system-images;android-30;google_apis;x86_64"
After installing or making sure the above are installed you can go ahead on creating avd.
Create an avd - avdmanager create avd -n TestAVD -k "system-images;android-30;google_apis;x86" --device "Pixel_4"
List created avds emulator -list-avds
Start Emulator or AVD emulator #TestAVD
I've resolved the issue by installing image first
like
sdkmanager --install "system-images;android-23;google_apis;x86"
and then it is possible to create the emulator
It seem that avdmanager can not find the local image. Please try:
cd YOUR_SDK_ROOT_DIRECTORY
avdmanager create avd -n test -k "system-images;android-23;google_apis;x86"
I am running latest version of Mac OS and I want to run android emulator through command line tool. I have run the following command on Mac terminal and got the following error.
$ emulator -list-avds
Pixel_XL_API_28
$ emulator -avd Pixel_XL_API_28
PANIC: Missing emulator engine program for 'x86' CPU.
I also run the command with available options like below that is also available on official documentation developer.android.com
$ /Users/janedoe/Library/Android/sdk/emulator/emulator -avd Pixel_XL_API_28 -netdelay none -netspeed full
What I need to do, so that I don't need to open android studios every time for only opening simulator.
Please follow the steps in your terminal in Mac
Step 1 ( Add Environment Variable )
export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
Step 2 ( .bash_profile / .bashrc )
Reload you .bash_profile Or .bashrc depending on OS
Step 3 ( go to emulator directory )
cd /Users/$(whoami)/Library/Android/sdk/emulator
Step 4 ( Get all list of Advs )
emulator -list-avds
Step 5 ( Run your Emulator Command Mode )
emulator -avd Nexus_5_API_22_Android_5.1
Take a look here : Android Emulator Error Message: "PANIC: Missing emulator engine program for 'x86' CPUS."
Then go as follows by cmd :
(the path to your emulators) - C:\Users\user\AppData\Local\Android\Sdk\emulator>
(the emulator name) - emulator.exe #Nexus_5 -dns-server 8.8.8.8 -writable-system
I am on an Arch Linux x86_64 bit system, 4 Cores, Intel i5 processor and 4 GB RAM.
I've been trying to run Android Emulator from the command line by doing $ANDROID_HOME/emulator/emulator -avd "Nexus_5_API_26", but I'm getting the following error:
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/home/cocoa/Downloads/SDK/]!
Here are the contents of that directory. I've tried the following post:
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value
Doesn't work. Thank you in advnace for replying
You can try using this:
cd $HOME/Android/Sdk/emulator; ./emulator -use-system-libs -avd Nexus_5_API_26 -netdelay none -netspeed full
I have the exact solution
ANDROID_SDK_ROOT path variable should point to the folder, which looks like below.
.
After the update of either underlying Linux System or Android system, we, each time we run the bash terminal, we need to update/run ANDROID_SDK_ROOT path variable. The bash.bashrc inside the /etc directory script runs everytime we open bash terminal.
Add, at the last line, your /etc/bash.bashrc file as below.
export ANDROID_SDK_ROOT=/home/upg/Android/Sdk
Other than this, if you want to update other environmental variables, such as $PATH, you can update that too there in bash.bashrc file.
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)
When I use the Mac OS X Terminal to navigate to the folder with my Android Emulator and type emulator, I get:
command not found
Here's what happens:
$ emulator
-bash: emulator: command not found
How do I get it to work?
The current directory is not normally included in your $PATH on a *nix operating system like OS X; to execute a program in the current directory, precede it with the path to the current directory (.):
$ ./emulator
Emulator can be added with Android Studio https://developer.android.com/studio/run/managing-avds.html
To start emulator: ~/Library/Android/sdk/tools/emulator -avd Nexus_5X_API_23
Related question: How do I launch the Android emulator from the command line?
solutions
1. Symbolic link
steps
create one symbolic link emulator
# soft link
$ ln -s ~/Library/Android/sdk/tools/emulator /usr/local/bin/emulator
call the command
# check all avd
$ emulator -list-avds
$ emulator #avd_name
# OR
$ emulator -avd avd_name
2. system environment
edit env with vim/vscode
# zsh
$ vim ~/.zshrc
# OR
$ code ~/.zshrc
add below lines to the .zshrc file
# export ANDROID_SDK_ROOT=/Users/xgqfrms/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_AVD_HOME=~/.android/avd
update config
# flush update
$ source ~/.zshrc
refs
https://developer.android.com/studio/run/emulator-commandline
These 3 command works for me on VS Code Terminal (Mac Book Pro M1)
echo 'export PATH=$PATH:~/Library/Android/sdk/emulator/' >> ~/.bash_profile
source ~/.bash_profile
emulator -list-avds
Open Android Studio. Click on AVD Manager (the icon with the android and phone) [example image: AVD Manager]. See the list of emulators. You should see something like "Install Emulator" if you don't have any.
Once this is successful, you'll get the tools folder downloaded to your ~/Library/Android/sdk
That is the folder you want, because it has the android and emulator command line tools.
typcally i use from terminal :
./Library/Android/sdk/emulator/emulator *some action*