4

Have someone got any tutorials for how to do testing on Android in Intellij? I am looking for resources similar to what you find for Eclipse with the ability to create a test project for my android project.

2 Answers 2

2

You can find some help in the IDEA forum thread.

Tests for Android application should be located in a separate module with its own AndroidManifest.xml file. To find out how to create tests for your Android application, you can use samples in Android SDK (i.e. "Snake" sample).

Create IDEA project from existing sources. 2 modules with Android facets will be created automatically: base module and "tests". Then add dependency between these module and compile. If compilation is successful, open some test class (i.e. "SkeletonAppTest" in "Snake" sample) in editor and select Run->SkeletonAppTest (with Android icon) in the popup menu: tests will run on emulator or device. You can create Android Tests run configuration to run tests in different scopes.

Unfortunately, IDEA 9 doesn't have an option to create test module for some base Android module. You can create it using SDK command-line tool.

Sign up to request clarification or add additional context in comments.

1 Comment

There is also a blog post explaining how it works in IDEA 10: blogs.jetbrains.com/idea/2010/09/android-unit-testing-support
-1

Here's the general Android/Eclipse info:

Android testing overview: http://developer.android.com/guide/topics/testing/index.html

Testing practicalities for Eclipse and command line: http://developer.android.com/guide/developing/testing/index.html

Tutorial: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html

and to create a test project in IntelliJ: http://blogs.jetbrains.com/idea/2010/09/android-unit-testing-support/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.