Skip to content


Subversion checkout URL

You can clone with
Download ZIP
DEPRECATED Arquillian Android Platform Containers
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
android-build [maven-release-plugin] prepare for next development iteration
android-configuration [maven-release-plugin] prepare for next development iteration
android-depchain [maven-release-plugin] prepare for next development iteration
android-drone [maven-release-plugin] prepare for next development iteration
android-impl [maven-release-plugin] prepare for next development iteration
android-spi [maven-release-plugin] prepare for next development iteration
android-tests [maven-release-plugin] prepare for next development iteration
.gitignore Modularization of Android Extension Minor README updates
pom.xml [maven-release-plugin] prepare for next development iteration

Arquillian Extension for the Android Platform

This extensions allows you to bring Arquillian Drone WebDriver based testing to Android devices. Extensions currently supports:

  • Creating new Android Virtual Devices
  • Reusing already existing Android Virtual Devices
  • Connecting to real devices
  • Injecting Android Device handler into test
  • Using Arquillian Drone to control your test


You have to do following steps, expecting your project was already set up to use Drone

  1. Download Android SDK from and point ANDROID_HOME system variable to directory where you extracted it. You should also update it via running android and navigating in the GUI.

  2. Add Android extension to dependencies


    Note: Make sure you have *NOT** Arquillian Drone Selenium Server on the classpath, as it will collide with Android unless configured to a different port. If you cannot remove it from classpath, you should disable it in arquillian.xml.

    <extension qualifier="selenium-server">
        <!-- this must be skipped, we run /wd/hub on emulator -->
        <property name="skip">true</property>
  3. Download Android Server APK to be installed to you mobile device from Use android-server-2.6.0.apk for devices including Android 2.3.4, latest version for Android 3.0 and newer.

  4. Set up WebDriver in arquillian.xml

    <extension qualifier="webdriver">
        <!-- this is optional if you set -->
        <property name="implementationClass"></property>
        <!-- this makes WebDriver connect hub on Android device -->
        <property name="remoteAddress">http://localhost:14444/wd/hub</property>
  5. Set up Android in arquillian.xml

    You should be aware that following might change in the future. You've been warned!

    <extension qualifier="android">
        <!-- this is optional, can be set via ANDROID_HOME property -->
        <property name="home">/home/kpiwko/apps/android-sdk-linux_x86</property>
        <!-- Nexus S -->
        <!-- <property name="serialId">3233E8EDB21700EC</property>-->
        <property name="apiLevel">13</property>
        <property name="avdName">SnapshotEnabled</property>
        <property name="emulatorBootupTimeoutInSeconds">180</property>

    Properties explained, required in bold:

    • home - ANDROID_HOME, can be ommited if set via ANDROID_HOME property
    • avdName - name of the Android Virtual Device. It will be either created or reused
    • apiLevel - (13) denotates API level, use android list target to get more variants
    • serialId - replaces avdName if set and availabel, represents a real device. Use adb devics to get the list
    • skip - (false) skip execution
    • force - (false) force emulator recreationg
    • sdSize - (128M) SD card size for emulator
    • emulatorBootupTimeoutInSeconds - (180) maximal time to get emulator started, use Snapshot enabled device if it takes too long
    • emulatorOptions - emulator options
    • abi - specify ABI

    Emulators are created by default in ${basedir}/${avdName}.

  6. Set up Android Drone in arquillian.xml

    You should be aware that following might change in the future. You've been warned!

    <extension qualifier="android-drone">
        <property name="androidServerApk">android-server-2.21.0.apk</property>

    Properties explained, required in bold:

    • androidServerApk - path to the Android Server APK you've downloaded
    • skip - (false) skip execution
    • webdriverPortHost - (14444) port on Host connected with port on device
    • webdriverPortGuest - (8080) port on Guest connected with port on Host

Interacting with Android Device from a test

You have the possibility to inject an instance of AndroidDevice into test using @ArquillianResource annotation. This is handy if you want for instance execute a shell command on the device or install an application, like in following:

@ArquillianResource AndroidDevice device;

public class AndroidApkInstallationTestCase {

    private final String INSTALLED_PACKAGES_CMD = "pm list packages";
    private final String CALCULATOR_APP = "com.calculator";

    AndroidDevice device;

    public void installAndUninstallApk() throws AndroidExecutionException {
        device.installPackage(new File("src/test/apk/calculator.apk"), true);

        List<String> installedApps = getInstalledPackages(device);

        Assert.assertTrue("Calculator app was installed", installedApps.contains(CALCULATOR_APP));


        installedApps = getInstalledPackages(device);
        Assert.assertFalse("Calculator app was uninstalled", installedApps.contains(CALCULATOR_APP));


If you need to have more detailed logging, you have to provide file as well as set it in Surefire plugin. Logging file can look like:

handlers= java.util.logging.ConsoleHandler

.level= FINEST

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format = %4$s: %5$s
java.util.logging.ConsoleHandler.level = FINEST

If you placed this file in src/test/resources/logging.propreties, Surefire execution will pick it up if following is defined:

Something went wrong with that request. Please try again.