IntelliJ IDEA 14.0.0 Web Help

Testing Android Applications

With IntelliJ IDEA you can generate and run unit tests for your Android applications using Android Testing Framework. Unit tests are stored in a dedicated module related to the target module that is going to be tested. Each module requires a separate test module. To execute unit tests, IntelliJ IDEA provides an Android-specific run configuration.

Unit testing of Android applications involves the following general steps:

To create a module for Android unit tests

  1. Select File | New Module from the main menu, or New | Module from the context menu of the Project tool window.
  2. On the first page of the New Module wizard that opens, select Test Module.
  3. On the next step of the wizard, specify the module name, the location of the .iml module file and the content root of the module.
  4. From the Tested module drop-down list, select the module against which you are going to run unit tests. Click Finish.

To run unit tests for an Android application

  1. Specify the tests that you want to run. Do one of the following:
  2. Select a run/debug configuration from the drop-down list on the main toolbar and start the test according to it.
  3. Monitor the test execution and view test results in the Test Runner tab of the Run tool window.

See Also

Last modified: 12 November 2014
comments powered by Disqus