简体   繁体   中英

Differences between testCompile and androidTestCompile for junit imports

What is the difference between these two import statements? (in build.gradle ):

testCompile 'junit:junit:4.12'

androidTestCompile 'junit:junit:4.12'

There's a great answer here explaining the difference:

Simply testCompile is the configuration for unit tests (located in src/test ) and androidTestCompile is used for the test API (located in src/androidTest ).

...

The main distinction between the two is the test sourceset runs in a regular Java JVM, whereas the androidTest sourceset tests run on an Android device (or an emulator).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM