Android build.xml configuration for MakeAppTouchTestable

Document created by DPM Admin Employee on Jul 18, 2017
Version 1Show Document
  • View in full screen mode

The MakeAppTouchTestable utility requres that Android projects have the following build.xml line:

<import file="custom_rules.xml" optional="true" />

Android developers should be aware that the build.xml file for a given project may not include this line if the build file was generated by an older Android SDK.

The remainder of this article presents the steps to add the required Import statement, if it is not already present. Users have the following options for adding it:

  1. Auto-generate the build.xml file with a newer Android SDK by running 'android update.'
  2. Add the line manually.

Option 1: Automatically Updating the build.xml file for your Android project

Use the following steps to automatically update the build.xml file.

  1. In the project folder, verify the location of the build.xml file.
  2. Remove the build.xml file from this project (you can delete it OR simply move it elsewhere).
  3. Verify the location of the Android SDK in use (if it is not already in the PATH on this environment).
  4. With the prior build.xml already deleted, run the following command-line command:

android update project -p <path to project dir>

Note: Use the absolute path, if necessary.

  1. Verify that the build.xml has been re-created in the expected location (the expected location was verified in Step 1 above) and that it contains the required import statement (also noted above). If it doesn't replace the line, consider either updating to a newer Android SDK or use the Option 2 manual method below.
  2. Once ready, run the MakeAppTouchTestable command.

Option 2: Manually Updating the build.xml file for your Android project

Use the following steps to manually revise the build.xml file.

  1. In the project folder, verify the location of the build.xml file.
  2. Open the build.xml file in a suitable editor.
  3. Locate the following line:

<import file="${sdk.dir}/tools/ant/build.xml" />

  1. Copy the import statement into place prior to the above line (with or without comment lines such as those in the screenshot above).
  2. Save the build.xml file
  3. Once ready, run the MakeAppTouchTestable command.

 

Attachments

    Outcomes