Book Image

Testing and securing android studio applications

Book Image

Testing and securing android studio applications

Overview of this book

Table of Contents (18 chapters)
Testing and Securing Android Studio Applications
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Running UI test cases


The Java test project created in the previous section has to be compiled into a JAR file to run your test cases. The JAR file has to be copied onto the same Android device in which the application under test is running. Follow the next steps to run your test case:

  1. Open the terminal panel in Android Studio (Tools | Open Terminal).

  2. Navigate to the Android Studios tools folder where the android executable is found:

    $ cd androidSDK/tools/
    
  3. Get the ID of the Android target that you want to use in your project. Execute the android executable with the list of the target actions. This command will list the available Android targets along with their IDs:

    $ ./android list targets
    
  4. Execute the android executable with the create uitest-project action. This command receives the name of the output project (-n), the ID of the Android target (-t), and the path of your Java test project (-p) as parameters. This step is to generate the project's build file as a test project:

    $ ./android...