Install the Android Emulator

UDocs' Android mobile exploration runs on an emulator already installed on your machine; it does not automatically download system images or create an AVD for you. First complete the installation of Android Studio, the SDK, and the emulator toolchain, start at least one AVD, then return to UDocs' “Tool Installation → Exploration Tools” and click “Refresh Detection”.

The recommended configuration is Pixel 9 Pro XL and Android 13 (API 33). The device model and system version do not have to match exactly, as long as the emulator can start normally on your machine and be recognized by adb.

1. Install Android Studio

Download the installer package matching your current system from the Android Studio official download page.

  • macOS: Choose the version for Apple silicon or Intel chips. You can also run brew install --cask android-studio.
  • Windows: Run the installer and choose the Standard installation when launching it for the first time.
  • Linux: Extract or install it according to the instructions on the download page, and make sure the current user has permission to run the emulator.

After opening Android Studio for the first time, go to Settings / Preferences → Languages & Frameworks → Android SDK → SDK Tools, select and install Android SDK Command-line Tools (latest). Without this item, sdkmanager and avdmanager will not appear in the terminal. Also confirm that Android Emulator is installed.

2. Configure SDK environment variables

macOS / Linux

export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"

The default SDK directory on Linux is usually $HOME/Android/Sdk; adjust ANDROID_HOME according to the actual installation location. To make the change persist, add the two export lines to ~/.zshrc or your current shell's configuration file, then reopen the terminal.

Windows

The default SDK directory is usually %LOCALAPPDATA%\Android\Sdk. Set ANDROID_HOME in “System Properties → Environment Variables”, and add the following directories to Path:

%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\cmdline-tools\latest\bin

Reopen the Command Prompt before continuing.

3. Install SDK components

macOS and Linux:

SDKMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager"
"$SDKMANAGER" --licenses
"$SDKMANAGER" "platform-tools" "emulator" "platforms;android-33" \
  "system-images;android-33;google_apis;arm64-v8a"

Apple silicon uses arm64-v8a; Windows, Linux, and Intel Macs usually use x86_64. Windows example:

"%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager.bat" --licenses
"%ANDROID_HOME%\cmdline-tools\latest\bin\sdkmanager.bat" "platform-tools" "emulator" "platforms;android-33" "system-images;android-33;google_apis;x86_64"

The license command will repeatedly ask whether you accept; enter y and press Enter for each item.

4. Create and start an AVD

macOS / Linux:

AVDMANAGER="$ANDROID_HOME/cmdline-tools/latest/bin/avdmanager"
echo no | "$AVDMANAGER" create avd \
  -n "Pixel_9_Pro_XL_API_33" \
  -k "system-images;android-33;google_apis;arm64-v8a" \
  -d "pixel_9_pro_xl"

emulator -avd Pixel_9_Pro_XL_API_33
adb devices

Windows:

avdmanager.bat create avd -n "Pixel_9_Pro_XL_API_33" -k "system-images;android-33;google_apis;x86_64" -d "pixel_9_pro_xl"
emulator.exe -avd Pixel_9_Pro_XL_API_33
adb.exe devices

After the emulator starts, adb devices should show a line with status device. You can also create and start an emulator directly in Android Studio's Device Manager.

5. Return to UDocs to check

  1. Keep the emulator running.
  2. Open “Tool Installation” on the left side of UDocs and find “Exploration Tools”.
  3. Click “Refresh Detection” and confirm that the Android Emulator entry can recognize your local environment.
  4. Open the documentation authoring page of the mobile app project, and for the node, select “More Actions → UI Exploration”.
  5. In the Device ID drop-down list, you should see the AVD you just started; if the list is empty, refresh detection, reopen the configuration page, or directly enter the serial number shown by adb devices.

The mobile emulator is optional and does not block Web project exploration. It is used only in automatic exploration for Android projects.

Common issues

  • Cannot find sdkmanager: Return to SDK Tools in Android Studio and confirm that Android SDK Command-line Tools is installed.
  • adb devices shows no device: Confirm that the emulator has finished starting; if necessary, run adb kill-server and then run adb devices again.
  • UDocs does not list the emulator: Confirm that the UDocs service was started after ANDROID_HOME and PATH were set. After changing environment variables, restart UDocs, then click “Refresh Detection”.
  • The emulator fails to start: Check virtualization support, disk space, and whether the system image architecture matches your current machine. Do not install x86_64 images on Apple silicon.