- Install Java: Download and install Java from here. Make sure you set the JAVA_HOME environment variable. You can check if Java is installed correctly by running the command java --version in any command prompt window, which should display the installed Java version.
- Install Android SDK Command line tools:
- Download the Command line tools and extract them.
- Move the extracted
cmdline-tools
directory to a new directory of your choice, for example,android_sdk
. This new directory will be your Android SDK directory. - Inside the extracted
cmdline-tools directory
, create a new subdirectory namedlatest
. - Move the contents of the original cmdline-tools directory (including the
lib
directory,bin
directory,NOTICE.txt
file, andsource.properties
file) to the newly createdlatest
directory. Now, you can use the command line tools from this location.
- Install platform tools: Run the following command in the command prompt:
android_sdk\cmdline-tools\latest\bin\sdkmanager.bat "platform-tools" "platforms;android-33"
- Download the Android image (API-level: 33):
android_sdk\cmdline-tools\latest\bin\sdkmanager.bat "system-images;android-33;google_apis_playstore;x86_64"
- Create an Android Virtual Device (AVD):
android_sdk\cmdline-tools\latest\bin\avdmanager.bat create avd -n avd33 -k "system-images;android-33;google_apis_playstore;x86_64"
- Launch the AVD:
- For the Android GUI:
android_sdk\emulator\emulator.exe -avd avd33 -memory 512 -partition-size 1024 -no-snapshot-load
- For headless mode (no Android GUI):
android_sdk\emulator\emulator.exe -avd avd33 -memory 512 -partition-size 1024 -no-snapshot-load
- Test ADB connection:
android_sdk\platform-tools\adb.exe connect 127.0.0.1:5555
android_sdk\platform-tools\adb.exe devices
- Run the following command to install the ATX application on the emulator:
python3 -m uiautomator2 init
The installation process for Linux is similar to Windows, with some additional steps:
- Install Java and set the environment variables:
export JAVA_HOME=/home/user_name/java/jdk-xx.x.x.x # Replace with your actual JDK installation directory
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
- Follow the same steps as Windows for installing Android SDK Command line tools, platform tools, and creating an AVD.
- Launch the AVD:
- For the Android GUI:
android_sdk\emulator\emulator -avd avd33 -memory 512 -partition-size 1024 -no-snapshot-load
- For headless mode (no Android GUI):
android_sdk\emulator\emulator -avd avd33 -memory 512 -partition-size 1024 -no-snapshot-load
- Test ADB connection:
android_sdk\platform-tools\adb connect 127.0.0.1:5555
android_sdk\platform-tools\adb devices
- Run the following command to install the ATX application on the emulator:
python3 -m uiautomator2 init
- Please mannuly setup your Google account
- Turn off APP auto-upgrade in Google Play
- If you encounter the error "packaging.version.InvalidVersion: Invalid version: ''", you may need to enable uiautomator2 in the emulator:
- On the emulator, open the ATX app
- Click on "Start uiautomator"
- Cannot
set_text
in TextView or EditView CheckSettings
->System
->Language & Input
->Physical Keyboard
-> turn onUse on-screen keyboard
- Black screen
https://www.cnblogs.com/yongdaimi/p/17464095.html
android_sdk\emulator\emulator.exe -avd avd33 -memory 512 -partition-size 1024 -no-snapshot-load