問題描述
沒有模擬器的Android測試 (Android tests without emulator)
Is it possible to run some android tests for example: AndroidTestCase without using emulator?
‑‑‑‑‑
參考解法
方法 1:
Or you can use external testing frameworks for that, such as Robolectric.
See also: Best practices for unit testing Android apps
方法 2:
You need an Android emulator or Android device to run Android APK files, including those APK files that implement AndroidTestCase subclasses used to test other APK file contents.
方法 3:
You may want to check Roboelectric.
(by matkk、bruno.braga、CommonsWare、Maciej Łopaciński)