Using the MakeAppTouchTestable Utility- Developer Only (Android)

Document created by DPM Admin Employee on Jul 18, 2017Last modified by Trishala Kalal on Aug 9, 2017
Version 2Show Document
  • View in full screen mode

TouchTest™ uses the MakeAppTouchTestable Utility, which is downloaded from the TouchTest, Resources page, to modify the Android project or the compiled APK.

 

Note: The TouchTest user specified to run the MakeAppTouchTestable utility must be a user with Mobile Device Administrator rights. TouchTest Lite users have admin rights for the given device on their own instance.

Static vs Dynamic Instrumentation

The MATT utility supports two instrumentation methods: static and dynamic.

  • Dynamic instrumentation occurs when MATT instruments a compiled file (i.e. an APK file). This method requires that you compile your Android project first to create an APK, after which it can be instrumented using SOASTA 51.07 or later (TouchTest 7040.58). Dynamic instrumentation is available for all supported Android versions.
  • Static instrumentation occurs when MATT instruments an Android project. Static instrumentation is available in all TouchTest releases and for all supported Android versions.

Making the DroidFish APK TouchTestable (Native Developer Only)

This section presumes that the APK file has already been compiled. Do so at this time (without applying the MATT command) to proceed using the following steps. The Java memory parameter is used prior to MATT.

  1. On the command line, navigate to the MakeAppTouchTestable folder you created above.

For example, in Windows Command Prompt,

cd C:\Documents\MakeAppTouchTestable

For example in Mac OS X Terminal,

cd ~/Documents/Demo/MakeAppTouchTestable

  1. Next, run the utility on the DroidFish APK using your own modified version of the MakeAppTouchTestable command below

For Mac OS X:

java -Xmx1g -jar MakeAppTouchTestable.jar -apk -androidsdk -url -username -password

For Windows:

C:\Users\\MakeAppTouchTestable>java -Xmx1g -jar MakeAppTouchTestable.jar -apk -androidsdk -url -username -password

 

TIP:  Copy the above command into a text file to build your own command.

 

where

 

  • <Android APK> is the path to the APK file. As we noted above, our example path under Mac OS X was: ~/Documents/Demo/droidfishchess_android
  • <Android SDK Path> is the path to the Android SDK used to compile the APK file.
  • <TouchTest URL> is the TouchTest Lite or TouchTest instance in use.
  • Using the Java parameter -Xmx1g prior to jar allocates the necessary memory to complete the operation. Otherwise, the MATT command may throw an exception.

Here is a complete Mac OS X example:

java -Xmx1g -jar MakeAppTouchTestable.jar -apk ~/Documents/Demo/droidfishchess_android/bin/Droidfish.apk -androidsdk ~/Development/android-sdk-macosx -url http://10.0.1.9/concerto -username SOASTA_DOC -password secret

 

Here is a complete Windows example:

C:\Users\\MakeAppTouchTestable>java -Xmx1g -jar MakeAppTouchTestable.jar -apk C:\Documents\Demo\droidfishchess_android\bin\Droidfish.apk -androidsdk C:\Development\android-sdk-macosx -url http://10.0.1.9/concerto -username SOASTA_DOC -password secret -Xmx1g

 

  • Optionally, you can manually specify an additional launchurl flag, being sure to specify the correct URL syntax (shown below). This argument is used in the TouchTest repository to represent your mobile app and in the compiled app. For Eclipse projects, this setting originates in the AndroidManifest.xml. Whether you create the TouchTestable Android app using the project or apk MATT parameter—this launchurl must match for testing to succeed.

For example,

-launchURL “Droidfish://key1=value1&key2=value2&key3=value3”

 

MakeAppTouchTestable will configure your project, and create a new Mobile App object in the TouchTest server repository. The Mobile App object created will have the auto-created URL Scheme in its Launch URL field. The following text output appears in Terminal:

Mobile App Object "Droidfish" representing your Application "Droidfish" has been created in TouchTest Repository.

 

The Mobile App object created will have the auto-created scheme found in tiapp.xml unless otherwise specified.

 

You will see a message similar to the following:

Will create the launch url: touchtest-e4eedd67-4ea9-495a-be57-2d34eaafc510://

Making the DroidFish Project TouchTestable (Native Developer Only)

 

  1. On the command line, navigate to the MakeAppTouchTestable folder you created above.

For example, in Windows Command Prompt,

cd C:\Documents\MakeAppTouchTestable

 

For example in Mac OS X Terminal,

cd ~/Documents/Demo/MakeAppTouchTestable

 

  1. Next, run the utility on the DroidFish project using your own modified version of the MakeAppTouchTestable command below

For Mac OS X:

sh MakeAppTouchTestable/bin/MakeAppTouchTestable -project -url -username -password For Windows: C:\Users\\MakeAppTouchTestable>sh MakeAppTouchTestable/bin/MakeAppTouchTestable -project -url -username -password

 

For Windows:

C:\Users\\MakeAppTouchTestable>sh MakeAppTouchTestable/bin/MakeAppTouchTestable -project -url -username -password

 

TIP: Copy the above command into a text file to build your own command.

 

Where:

  • <Android Project File> is the path to the root folder of your project. As we noted above, our example path under Mac OS X was: ~/Documents/Demo/droidfishchess_android
  • <TouchTest URL>is the TouchTest Lite or TouchTest instance in use. In the example below, we show a TouchTest Lite instance on a LAN with an Apple router, 10.0.1.9, but your TouchTest server may have a domain or IP address prior to /concerto.

 

Here is a complete Mac OS X example:

sh MakeAppTouchTestable/bin/MakeAppTouchTestable -project ~/Documents/Demo/droidfishchess_android -url http://10.0.1.9/concerto -username SOASTA_DOC -password secret

Here is a complete Windows example:

C:\Users\\MakeAppTouchTestable>sh MakeAppTouchTestable/bin/MakeAppTouchTestable -project C:\Documents\Demo\droidfishchess_android -url http://10.0.1.9/concerto -username SOASTA_DOC -password secret

  • Optionally, you can manually specify an additional launchurl flag, being sure to specify the correct URL syntax (shown below). This argument is used in the TouchTest repository to represent your mobile app and in the compiled app. For Eclipse projects, this setting originates in the AndroidManifest.xml. The launch URL in the compiled app and in the TouchTest, Mobile App, launch URL field must match for testing to occur.

For example,

-launchURL "Droidfish://key1=value1&key2=value2&key3=value3"

MakeAppTouchTestable will configure your project, and create a new Mobile App object in the TouchTest server repository. The Mobile App object created will have the auto-created URL Scheme in its Launch URL field. The following text output appears in Terminal:

Mobile App Object "Droidfish" representing your Application "Droidfish" has been created in TouchTest Repository.

The Mobile App object created will have the auto-created scheme found in tiapp.xml unless otherwise specified. You will see a message similar to the following:

Will create the launch url: touchtest-e4eedd67-4ea9-495a-be57-2d34eaafc510://

 

Next Step

Now that you've instrumented your project using the MATT utility, you need to download TouchTest Agent and register your Android device. Please find detailed instructions here.

 

Go to: TouchTest Onboarding

Attachments

    Outcomes