问题描述
我做了的步骤
- 从 Square 下载了Runner JAR和Client JAR
- 将
spoon-client-1.1.2.jar
复制到libs文件夹,右键单击->另存为库...". -
编写了一个简单的虚拟测试:
- Downloaded Runner JAR and Client JAR from Square
- Copied
spoon-client-1.1.2.jar
to the libs folder, right click --> Add As Library... wrote a simple dummy test:
public MainActivityTest() {
super(MainActivity.class);
}
public void test() {
Spoon.screenshot(getActivity(), "initial_state");
}
Ran MainActivity
Ran MainActivity
Ran MainActivityTest(测试已通过)
Ran MainActivityTest (Tests passed)
将app-debug.apk
和app-debug-androidTest-unaligned.apk
从项目复制到与spoon-runner-1.1.2-jar-with-dependencies.jar
CMD->切换到我放置三个文件的文件夹
CMD -> switched to the folder where I put the three files
已执行java -jar spoon-runner-1.1.2-jar-with-dependencies.jar --apk app-debug.apk --test-apk app-debug-androidTest-unaligned.apk
输出: Exception in thread "main" java.lang.NullPointerException: SDK path not specified. at com.google.common.base.Preconditions.checkNotNull<Preconditions.java:226> at com.squareup.spoon.SpoonRunner$Builder.setAndroidSdk<SpoonRunner.java:228> at com.squareup.spoon.SpoonRunner.main>SpoonRunner.java:437>
SDK位于C:\Users\myUser\AppData\Local\Android\Sdk
中,我可以在以下位置看到路径:文件->项目结构-> SDK位置(Android Studio)
The SDK is located in C:\Users\myUser\AppData\Local\Android\Sdk
and I can see the path under: File -> Project Structure -> SDK Location (Android Studio)
出了什么问题?
推荐答案
Android SDK路径存在问题.但是,指定路径确实可以解决问题.完整的命令如下所示:
There is a problem with the Android SDK path. However specify the path did the trick. The full command looks like:
java -jar spoon-runner-1.1.2-jar-with-dependencies.jar --apk app-debug.apk --test-apk app-debug-androidTest-unaligned.apk --sdk C:\Users\myUser\AppData\Local\Android\sdk
这篇关于未指定SDK路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!