Skip to content

Instantly share code, notes, and snippets.

@tinytengu
Last active October 4, 2022 01:26
Show Gist options
  • Save tinytengu/83a596f13d78f8ddd4ce092b0050e338 to your computer and use it in GitHub Desktop.
Save tinytengu/83a596f13d78f8ddd4ce092b0050e338 to your computer and use it in GitHub Desktop.
Ubuntu 22.04 AndroidSDK Install
# AndroidSDK
sudo snap install androidsdk
# JDK 8
sudo apt-get install openjdk-8-jdk
sudo update-alternatives --config java
# .bashrc / .zshrc
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export ANDROID_HOME="$HOME/AndroidSDK"
export PATH="$PATH:$ANDROID_HOME/build-tools/27.0.3"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export PATH="$PATH:$ANDROID_HOME/tools/bin"
export PATH="$PATH:$ANDROID_HOME/emulator"
# cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected.
# Install image first:
sdkmanager --install "system-images;android-27;google_apis;x86"
# Then run avdmanager
avdmanager create avd -n test -k "system-images;android-27;google_apis;x86"
# Start adb server
adb start-server
# Start emulator
emulator -avd test
# WARNING: Host CPU is missing the following feature(s) required for x86 emulation: SSSE3
# Hardware-accelerated emulation may not work properly!
# Consider installing arm images instead
sdkmanager --install "system-images;android-27;google_apis;arm64-v8a"
# qemu-system-aarch64: PCI bus not available for hda
emulator -avd test -qemu -machine virt
# Also try pixel_xl and -gpu on
emulator -gpu on -avd test -qemu -machine virt
# If you're f-d up as bad as my old PC (or it's something with Ubuntu), you should
# at least try Trial version of Genymotion and look what it's got to say. Thanks to this thing
# I've figured out that only Android 6 and lower available for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment