efxtv

Install Android SDK & Create AVD (Android 13 / API 33)

Nov 1st, 2025 (edited)
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | Cryptocurrency | 0 0
  1. Fastest way to setup android-cli-tool
  2.  
  3. =====================================================================================================================
  4. Install Android SDK & Create AVD (Android 13 / API 33)
  5.  
  6. Simple one-time setup script to install Android command-line tools, SDK, and create an Android Virtual Device (AVD) using OpenJDK 17.
  7.  
  8. # 1️⃣ Update system and install essential packages
  9. sudo apt update && sudo apt upgrade -y
  10. sudo apt install -y openjdk-17-jdk wget unzip git curl nano
  11.  
  12. # 2️⃣ Download the latest Android command-line tools
  13. wget https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip
  14.  
  15. # 3️⃣ Create SDK directory structure
  16. mkdir -p ~/Android/cmdline-tools/
  17. mv cmdline-tools/ latest
  18.  
  19. # 4️⃣ Extract the downloaded command-line tools to the SDK path
  20. unzip commandlinetools-linux-13114758_latest.zip -d ~/Android/cmdline-tools
  21.  
  22. # 5️⃣ Go to the extracted directory
  23. cd ~/Android/cmdline-tools
  24.  
  25. # 6️⃣ Rename folder to 'latest' (required by Android SDK layout)
  26. mv cmdline-tools/ latest
  27.  
  28. # Full Path
  29. ~/Android/cmdline-tools/latest/bin
  30.  
  31. # 7️⃣ Edit your shell profile to add environment variables
  32. nano ~/.profile
  33.  
  34. # 8️⃣ Add SDK environment variable (inside ~/.profile)
  35. export ANDROID_SDK_ROOT=$HOME/Android
  36.  
  37. # 9️⃣ Add Android tools to PATH (also inside ~/.profile)
  38. export PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/platform-tools:$PATH
  39.  
  40. # 🔁 Apply environment changes
  41. source ~/.bashrc
  42.  
  43. # 🔍 Navigate to the SDK tools directory
  44. cd $ANDROID_SDK_ROOT/cmdline-tools/latest/bin
  45.  
  46. # ⚙️ Install essential Android components (platform-tools, emulator, SDKs)
  47. sdkmanager "platform-tools" "emulator" "platforms;android-33" "system-images;android-33;google_apis;x86_64"
  48.  
  49. # ✅ Accept all SDK licenses
  50. sdkmanager --licenses
  51.  
  52. # 📱 Create an Android Virtual Device (AVD)
  53. avdmanager create avd -n myAVD -k "system-images;android-33;google_apis;x86_64" --device "pixel"
  54.  
  55.  
  56. 15 $ANDROID_SDK_ROOT/emulator/emulator -avd myAVD # Wih KVM (faster)
  57. 16 $ANDROID_SDK_ROOT/emulator/emulator -avd myAVD -no-accel # No KVM (normal/slow)
  58. 17 $ANDROID_SDK_ROOT/emulator/emulator -avd myAVD -gpu swiftshader_indirect # Software based graphics (fastest)
  59. 18 $ANDROID_SDK_ROOT/emulator/emulator -avd myAVD -memory 8192 -qemu -smp cores=2 # add more RAM and cores
  60. =====================================================================================================================
  61.  
  62. #FEDORA
  63. sudo dnf install @virtualization;sudo dnf builddep qemu
  64.  
  65. #UBUNTU
  66. sudo apt install qemu-kvm libvirt-daemon-system virtinst virt-manager;sudo apt update && sudo apt build-dep qemu
  67.  
  68. # List installed devices
  69. emulator -list-avds
  70. =====================================================================================================================
  71.  
  72. 🧩 Step-by-step setup for Android TV Emulator
  73. # 1️⃣ Install Android TV system images
  74. sdkmanager "system-images;android-33;android-tv;google_apis;x86_64"
  75.  
  76. # 2️⃣ Create an Android TV AVD (emulator)
  77. avdmanager create avd -n AndroidTV \
  78. -k "system-images;android-33;android-tv;google_apis;x86_64" \
  79. --device "tv_1080p"
  80.  
  81. # 3️⃣ List available AVDs
  82. emulator -list-avds
  83.  
  84. # 4️⃣ Run the Android TV emulator
  85. emulator -avd AndroidTV
  86.  
  87. =====================================================================================================================
  88.  
  89. ⚙️ Step-by-Step: Create a Wear OS Emulator
  90.  
  91. # 1️⃣ Install Wear OS system image
  92. sdkmanager "system-images;android-33;wearos;google_apis;x86_64"
  93.  
  94. # 2️⃣ List available Wear OS device definitions
  95. avdmanager list device | grep -i wear
  96.  
  97. # 3️⃣ Create a new Wear OS virtual device
  98. avdmanager create avd -n WearOS \
  99. -k "system-images;android-33;wearos;google_apis;x86_64" \
  100. --device "wearos_small_round"
  101.  
  102. # 4️⃣ List available AVDs to confirm creation
  103. emulator -list-avds
  104.  
  105. # 5️⃣ Launch the Wear OS emulator
  106. emulator -avd WearOS
  107.  
Advertisement
Add Comment
Please, Sign In to add comment