If the AddAndroidApp.jar runs successfully, it returns an exit code of 0. Otherwise, it returns an exit code of 1.
Type the following command to learn about mandatory and optional parameters for the AddAndroidApp.jar command line tool.
java -jar AddAndroidApp.jar options
Command-line arguments and option | Description |
---|---|
-w | Workbench URL, which includes the IP address and port, for example, http://127.0.0.1:7878 |
Android application (.apk) | The name of the Android app, for example, Calculator.apk. You can include multiple .apk files on the command line. |
-c | Closes the test workbench after all of the apps have been added to the workbench, for example, eclipse -launcher.appendVmargs -vmargs -Dcom.ibm.rational.test.lt.services.server.moeb.CLI=true. This option requires that the workbench be launched with the com.ibm.rational.test.lt.services.server.moeb.CLI system property set to true. To close the workbench automatically, use the Eclipse preference Confirm exit when closing the last window. and check |
-d | Description. The text for the description for this application. The text will be displayed in the Mobile and Web UI Applications editor in the workbench. |
-f | Forcibly rebuild. If the exact same version of the Android application was already added to the workbench, the application is forcibly rebuilt another time. |
-m | .ma file. The workspace folder where the .ma resource for this application is created. This option is ignored if the workspace folder is not found. |
-o | Output folder. The local folder where the instrumented applications are downloaded to. |
-v | Version. Displays the version of the AddAndroidApp.jar tool. |
-alias | The alias from the keystore to be used to sign all of the applicationss that are produced |
-keepdata | Keep application data during installation on the device. Use this with signing options as it requires the same signature as the original application. |
-keystore keystore | The local path of the keystore that contains the private key to be used to sign all of the generated applicationss. |
-aliaspassword alias-password | The password of the alias. |
-keystorepassword keystore-password | The password of the keystore. |
Run the following command to instrument an AUT, such as Calculator.apk and add it the workbench:
java -jar AddAndroidApp.jar -w http://192.0.2.24:7878 Calculator.apk
Run the following command to instrument multiple applications and add them to the workbench. Simply include the names of the .apk files to the command line, as follows:
java -jar AddAndroidApp.jar -w http://192.0.2.24:7878 Calculator.apk MySimpleApp.apk MySecondApp.apk
Run the following commands to start the workbench, instrument the AUT, and close the workbench:
eclipse -launcher.appendVmargs -vmargs -Dcom.ibm.rational.test.lt.services.server.moeb.CLI=true
java -jar AddAndroidApp.jar -w http://192.0.2.24:7878 -c Calculator.apk
Run the following command to instrument the AUT and download the generated application to a local folder:
java -jar AddAndroidApp.jar -w http://192.0.2.24:7878 -o localdir Calculator.apk