UI Testing tool android from ADT21

android, testing

Solution

The answer was really simple. Examples shows you 1, what the -t actually wants is a target but the id is dependant on the results of running the command:

android list targets

This command will give you a list of targets you can use with IDs dependant on what you have installed on your system.

For example on my system i got:

id: 37 or "android-16"
 Name: Android 4.1.2
 Type: Platform
 API level: 16
 Revision: 3
 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 ABIs : armeabi-v7a, mips, x86

So i use the command

android create uitest-project -n <name> -t 37 -p <path>

Problem

Trying to get the android UI Testing that comes as part of ADT21 (http://developer.android.com/tools/testing/testing_ui.html) to work currently and I seem to be running into some issues. After creating a test we have to set it up as a uitest-project, the web page tells us the command is: ``` <android-sdk>/tools/android uitest-project -n <name> -t 1 -p <path> ``` But this appears to be incorrect and it should be: ``` <android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path> ``` But on running this I get the error: ``` Error: UI test projects can only target API 16 and above ``` Which i assume related to the -t parameter, i have then since tried all the values from 1 to 18 (a version of android that doesn't even exist yet) and it gives me the same error. Anyone figured it out? I assume it is going to be something simple.

Original source