Case01: Set Up for the Android Emulator
Download the Android SDK Command-Line Tools
-
Install the necessary tools:
# create a directory for the cli-tools, and move the .zip file into the directory mkdir android_sdk cd android_sdk mv <PATH_TO_YOUR_DOWNLOADED_ZIP_FILE> . # unzip the downloaded file, and put the contents in the new directory 'latest/' unzip commandlinetools-<YOUR_PLATFORM>-8512546_latest.zip mkdir cmdline-tools/latest cd cmdline-tools/latest mv ../* . # The hierarchy of the 'android_sdk/': └- android_sdk/ ├- cmdline-tools/ ├- latest/ ├- bin/ ├- lib/ ├- NOTICE.txt └- source.properties # Install platform and build tools # You can fetch the complete list of available packages via: bin/sdkmanager --list # Install the desired package and tools via: bin/sdkmanager --install "system-images;android-33;google_apis;x86_64" # The above command will download and install the tools in the sdk_root (android_sdk/)
-
Download and install the Emulator:
bin/sdkmanager --install "emulator"
-
Create a new avd device:
bin/avdmanager create avd -n mytestdevice -k "system-images;android-33;google_apis;x86_64"
-
Check if the avd device is available:
# go to the 'emulator/' directory, and run the command cd ../../emulator ./emulator -list-avds # Now you should see your newly created avd device `mytestdevice`
-
Run the emulator
./emulator -avd mytestdevice
Case02: Set Up for a real Android Device
Go to the official site and download the SDK Platform-Tools
-
Unzip the .zip file. You can find the adb binary within the extracted directory.
cd platform-tools # Show every available Android device ./adb devices
Top comments (0)