Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
561 views
in Technique[技术] by (71.8m points)

Install Android emulator without installing Android Studio

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:- https://stackoverflow.com/a/59907256/11620356 https://developer.android.com/studio/command-line https://dev.to/koscheyscrag/how-to-install-android-emulator-without-installing-android-studio-3lce https://stackoverflow.com/a/61176718/11620356 How do I download the Android SDK without downloading Android Studio?

question from:https://stackoverflow.com/questions/65546475/install-android-emulator-without-installing-android-studio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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;arm64-v8a" "platforms;android-25" "platform-tools"
./sdkmanager --licenses
./avdmanager -v create avd -n Nougat -k "system-images;android-25;default;arm64-v8a"
../../../emulator/emulator -avd Nougat

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...