Search code examples
androidantcode-coverageemma

Regarding EMMA and testing on android


Why do you need to have an emulator or device plugged in for the testing to take place? Why can't I just generate coverage for my tests without the use of these?


Solution

  • It all depends on your Unit-Test.

    If you're testing classes that dont use at all the Android Framework, and only the standard Java classes, then you could run the Unit test and get a code coverage (althouhg I don't have a step by step procedure to give you).

    But if you're using any part of the Android Framework (that is, any class in an android.* or com.android.* package), then you'll need to run in a DalvikVM, meaning an Android emulator.