joplin-notes/joplin notion extension/Web Development/Extras/Android emulator on linux.md
2026-11-04 00:33:23 +05:30

96 lines
No EOL
3.4 KiB
Markdown

Android emulator on linux
- https://repodev.com/blog/install-android-sdk-without-android-studio
- https://stackoverflow.com/questions/70752639/i-need-to-install-android-api-30-but-i-cannot-see-that-api-in-the-sdk-platform
https://dl.google.com/android/repository/sys-img/google_apis/x86-30_r09.zip : for downloadng system images
https://androidsdkmanager.azurewebsites.net/SDKPlatform
 
- Download commandlinetools and gradle
https://www.mediafire.com/file/zjubjy2d2nmblwf/commandlinetools-linux-10406996_latest.zip/file
https://www.mediafire.com/file/26sokfserayh28a/gradle-8.5-bin.zip/file
Or use official sites
https://developer.android.com/studio/index.html#command-line-tools-only
https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip : ddl link for cmdtools
https://gradle.org/releases/ : for gradle
compatibility matrix:
https://docs.gradle.org/current/userguide/compatibility.html
- Files hierarchy
```
/home/username/bin/android/sdk/cmdline-tools/latest/
|_bin/
|_lib/
|_NOTICE.txt
|_source.properties
/home/username/bin/android/gradle/gradle-x.x.x/
|_bin/
|_docs/
|_init.d/
|_lib/
|_src/
|_LICENSE
|_NOTICE
|_README
```
- Go to bin directory for cmdtools
Then
` ./sdkmanager "platforms;android-30" "system-images;android-30;google_apis;x86_64" "platform-tools"`
`./sdkmanager --licenses`
Also install these
`sudo pacman -S libmtp android-tools android-udev`
- Add path in `.bashrc`
```
vi ~/.bashrc
# Android SDK files
export ANDROID_HOME="$HOME/bin/android/sdk"
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
# Gradle
export PATH=$PATH:$HOME/bin/android/gradle/gradle-x.x/bin
```
- Running
Create avd
`avdmanager create avd -n image_v29 -k "system-images;android-29;google_apis;x86_64"`
if there is error ie `emulator` must be installed then use this
`./sdkmanager --channel=3 emulator`
then
`avdmanager list avd`
Start it by going to emulator directory then
`./emulator -avd image_v29`
 
- Android versions
[android versions](../../../undefined)
or
https://developer.android.com/tools/releases/platforms
 
Open SDK Manager: First, locate and open the SDK Manager. You can find it in the tools directory of your Android SDK installation.
 
Launch SDK Manager: Run the sdkmanager command in your terminal or command prompt. Navigate to the tools/bin directory within your Android SDK installation and use the following command:
`sdkmanager --list`
This command will list all available packages and their versions.
 
Select and Install Previous Android Versions: Once you see the list of available packages, you can find the specific version you want to install. For instance, to install Android 9.0 (API level 28):
`sdkmanager "platforms;android-28"`
Replace "platforms;android-28" with the appropriate package name of the desired Android version. This command will download and install Android 9.0 (API level 28).
 
Additional Components: If you need additional components such as system images or tools for a specific version, you can install them using similar commands:
`sdkmanager "system-images;android-28;google_apis;x86_64"`
Again, adjust the package name to match the specific version and components you require.