3

I just want to set android emulator without studio-ide and use it like a mobile and tweak it.

I have downloaded command-line tools from https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip

Unzipped in folder $HOME/AndroidSDK.

I just want to run some emulators.

Then ran below

cd ~/AndroidSDK/cmdline-tools/bin
./sdkmanager --sdk_root=$HOME/AndroidSDK/cmdline-tools --list --include_obsolete --verbose
./sdkmanager --sdk_root=$HOME/AndroidSDK/cmdline-tools --verbose "emulator" "platforms;android-25" "system-images;android-25;default;arm64-v8a" "platform-tools"
./sdkmanager --sdk_root=$HOME/AndroidSDK/cmdline-tools --licenses
./avdmanager -v create avd -n Nougat -k "system-images;android-25;default;arm64-v8a"

I got below error when creating avd.

Error: Package path is not valid. Valid system image paths are:ository...
null

It is related to How create android emulator without android studio?
But I can't find proper solution to my problem.

Where it is going wrong?

Ref:-

HemanthJabalpuri
  • 344
  • 4
  • 11

1 Answers1

5

I am answering my own question.

Where I made wrong is, decompressing to wrong directory and using wrong --sdk_root. As said in here, I have to create a dir called cmdline-tools and decompress in it. Now we will have another cmdline-tools dir. We have to rename it to the respective commandline tool version we are using. In my case it is 3.0.

Finally my script should be look like below.

mkdir -p ~/AndroidSDK/cmdline-tools
cd ~/AndroidSDK/cmdline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -o tools.zip
unzip -q tools.zip
mv cmdline-tools 3.0
cd 3.0/bin
./sdkmanager --list --include_obsolete --verbose
./sdkmanager --verbose "emulator" "system-images;android-25;default;x86_64" "platforms;android-25" "platform-tools"
./sdkmanager --licenses
./avdmanager -v create avd -n Nougat -k "system-images;android-25;default;x86_64"
../../../emulator/emulator -avd Nougat

See https://github.com/HemanthJabalpuri/AndroidEmulator_without_Studio for more info.

HemanthJabalpuri
  • 344
  • 4
  • 11
  • Now I have new issue, above commands are for reference to me. Actually I didn't tested those. After I am executing avdmanager I got error with OpenJDK11 class `com.android.sdklib.repository.generated.repository.v1.PlatformDetailsType cannot be cast to class com.android.sdklib.repository.meta.DetailsTypes$SysImgDetailsType (com.android.sdklib.repository.generated.repository.v1.PlatformDetailsType and com.android.sdklib.repository.meta.DetailsTypes$SysImgDetailsType are in unnamed module of loader 'app')`. I tried with **JDK8** and one **JRE8** in AndroidStudio too. But same error repeats. – HemanthJabalpuri Jan 04 '21 at 14:40
  • This seems like it only appears when I install android versions that does not have separate system-image folders. – HemanthJabalpuri Jan 10 '21 at 06:49