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
Related
I tried to develop app using Flutter(using Android studio IDE).Add flutter plugin & flutter SDK in studio and Everything is configured but emulator / real time device are not listed. Its shows error like "Unable to list devices: Unable to discover Android devices. Please run "flutter doctor" to diagnose potential issues"
Ref link : https://flutter.io/setup-windows/#android-setup
https://flutter.io/get-started/test-drive/#androidsstudio
configure flutter in terminal to detect Android SDK and Android Studio:
$ flutter config --android-sdk /path/to/android/sdk
$ flutter config --android-studio-dir /path/to/android/studio
then restart Android Studio/Intellij.
source: https://github.com/flutter/flutter-intellij/issues/2113#issuecomment-383412308
If you configure flutter and android sdk both perfectly and you do not show the avd device list in android studio.
It's very simple way to show android emulator device list.
First create a new Android Emulator if already create you run the AVD manager then you can show the instead of emulator name
Before:
https://i.stack.imgur.com/6np0m.png
After:
https://i.stack.imgur.com/fiCYe.png
May be there is no AVD's to list down. And if emulator runnig, intelliJ will grab it.
In Android Studio, you can create a AVD using AVD Manager or using Terminal. Here is how you can do that using Terminal,
First, go to the android sdk installed directory -> tools
and copy the path and in the terminal type cd and paste the path and press enter. Now yo are in the tools directory.
Next, using terminal type:
emulator -list-avds - to list created AVD's(You should be in tools directory to run this command).
If there is a device type emulator -avd <name>. else you can create a one:
type cd bin then,
Use:
avdmanager create avd -n name -k "sdk_id" [-c {path|size}] [-f] [-p path]
As a example:
avdmanager create avd -n Nexus -d 23 -k system-images;android-23;google_apis;x86
Then again go back to tools directory by typing cd .. and type emulator -list-avds. This command will list your created AVD.
To run a AVD type:
emulator -avd <name>
About AVD.
Had the same problem after moving avd's to another disk.
I managed to solve by making ANDROID_HOME system variable to point to the android sdk path.
For mac users,
It was working fine yesterday. In my case I had this in .bash_profile
ANDROID_HOME = Library/Android/sdk
I changed it to,
ANDROID_HOME = /Users/rana.singh/Library/Android/sdk
.bash_profile has
export ANDROID_HOME=/Users/rana.singh/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
It worked.
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'd like to start developing a react-native app, and to do that I need an emulator. I am on an Ubuntu virtual machine, so I figured just using the command line tools would be fine. After fumbling around for a bit I ran
$ANDROID_HOME/bin/sdkmanager --include_obsolete --update
and
$ANDROID_HOME/bin/sdkmanager "platform-tools" "platforms;android-26"
Both returned "done" pretty quickly.
I tried to create an image to load up in the emulator...
$ANDROID_HOME/bin/avdmanager create avd --name "testbed" -k "system-
images;android-26;x64"
Error: Package path is not valid. Valid system image paths are:
And no system images are listed. How do I download system images properly?
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.
When launching DDMS from the command line in Lion (10.7.3) I get the following error:
E/adb: Failed to get the adb version: Cannot run program "/Users/stevieo/android-sdk-macosx/tools/adb": error=2, No such file or directory
This makes sense to me because adb is actually in: /Users/stevieo/android-sdks/platform-tools
How can I modify this path so that ddms will launch on my system?
I have looked into the ddms file itself, but cannot decipher its intent.
One note, I do NOT have this issue on Snow Leopard (10.6.8)....
TIA for any thoughts or assistance.
Regards,
Steve O'Sullivan
If you look into your tools directory where you launched ddms, you will see the adb_has_moved.txt which says:
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"
Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
To solve this, I would change your ~/.bash_profile to have a line like:
# --- add Android platform-tools directory
PATH=~/android-sdks/platform-tools:$PATH
export PATH
Make sure to open up a new Terminal window so it will reload ~/.bash_profile
Note that a possible reason why it is working on your 10.6.8 installation is that you may have an older version of the Android SDK, where adb was in still in the tools directory.
If you are trying from eclipse,
Please make sure to create a adb link in /usr/bin/ directory which should solve the problem:
Ex: ln -s /Users//android-sdks/platform-tools/adb /usr/bin/adb
Note: logging as sudo/root may be required