Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我切换到 Android Studio 之前,我在 IntelliJ IDEA 中使用“创建测试模块”来创建测试模块以将我的单元测试保存在那里。虽然我在 Android Studio 中找不到它。如何创建它来编写和运行测试?谢谢。
您可以将它们放在与您的 apk 源相同的模块中。创建一个这样的目录结构:
-<Project root> |-<Module name> |-src |-main |-com |-<company name> |-<app name> |-instrumentTest |-com |-<company name> |-<app name> <- Put your unittests here
您可以通过在 Android Studio 中创建新的运行配置来运行它们。选择一个新的 Android 测试运行。