Android SDK includes a mobile device emulator that lets you test Android applications without using a physical device. For more information about using the emulator, see the Android documentation:
With TestComplete, you can test Android applications running on this emulator. This topic provides detailed information on how to prepare the Android emulator for testing.
|Note:||Virtual machines running Android-x86 may have better performance than the Android emulator.|
To use the Android emulator for testing, your computer must meet the following requirements:
An Intel processor that supports the Intel Virtualization Technology. Check that your processor is listed at:
You need the following software to use the Android emulator with TestComplete:
Intel x86 Atom System Image
Intel Hardware Accelerated Execution Manager (HAXM) – a hardware virtualization driver that speeds up the Android emulator
You can download them using the Android SDK Manager:
Start the SDK Manager.
Select Windows > Android SDK Manager.
In Android Studio:
Select Configure > SDK Manager, or select File > Settings and then select Appearance & Behavior > System Settings > Android SDK
Select the following items:
Intel x86 Atom System Image for the Android version you want use in the emulator
Intel x86 Emulator Accelerator (HAXM)
Click OK, accept the license agreements and proceed with the installation.
As an alternative, you can install the packages by using the sdkmanager command-line utility. The utility is shipped with Android Studio or with standalone Android SDK tools:
For detailed information on the utility command-line parameters, see the utility description in the Android documentation.
The SDK Manager does not install the Intel HAXM driver automatically, it just downloads the HAXM installation package to the following location:
To install the HAXM driver, launch this file and follow the on-screen instructions to complete the installation. For HAXM installation notes, see the Intel web site:
|Note:||HAXM does not check for updates automatically. To update HAXM, download the new installation package using the SDK Manager and repeat the installation.|
To verify that the HAXM driver is running, open Windows command prompt and run the following command:
sc query intelhaxm
You should see the following output:
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
If HAXM is not running, you can start it using the following command:
sc start intelhaxm
The emulated Android Virtual Device (AVD) must be based on the Intel x86 image. To create such an AVD, do the following:
Start the Android Virtual Device Manager.
Select Window | Android Virtual Device Manager.
In the Android SDK Manager:
Select Tools | Manage AVDs.
From the Start menu:
Select All Programs | Android SDK Tools | AVD Manager.
Click New to create a new AVD.
Set the following AVD options:
Target: the Android version of the Intel x86 image that you downloaded
CPU/ABI: Intel Atom (x86)
RAM: 512 - 1024
SD Card | Size: any non-zero value
Use Host GPU:
Specify the AVD name and other options as needed.
Click Create AVD.
We also recommend that you install the agent if you want to perform black-box testing, as it is needed for simulating keystrokes and it simplifies testing geolocation activities.
For complete information on installing the Agent, see the Agent description.
|Requirement: In order for the Android Agent to be able to work on an emulator, the emulator must have 512 MB of RAM or more.|
TestComplete interacts with physical Android devices, emulators and virtual machines via Android Debug Bridge (adb.exe). ADB is part of the Android SDK, along with the Android emulator. In other words, if you have the Android SDK with the emulator, you also have the ADB installed.
When you launch the Android emulator, it is automatically connected to ADB, and TestComplete can work with it when it is ready.
Besides preparing the emulator for testing, you also need to configure TestComplete. For detailed information on this, see Preparing Test Computers and TestComplete for Android Testing.
Also, it is recommended to prepare your application for testing and test it as an Open Application. See Instrumenting Android Applications - Overview.