Spoon使おう!と思ってかんたんなコードを書き、2台の端末をつないで実行したら以下のようなエラーが出ました。
...
2016-03-08 11:06:56 [SR.runTests] [03103a11d0238834] Starting execution.
2016-03-08 11:06:56 [SDR.runInNewProcess] [03103a11d0238834]
2016-03-08 11:06:56 [SR.runTests] [01498AC603012008] Starting execution.
2016-03-08 11:06:56 [SDR.runInNewProcess] [01498AC603012008]
2016-03-08 11:06:57 [SDR.printStream] [03103a11d0238834] STDOUT 2016-03-08 11:06:57 [SDR.main] ERROR: Unable to execute test for target. Excep
tion message: Timeout getting device list.
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDOUT 2016-03-08 11:06:57 [SDR.main] ERROR: Unable to execute test for target. Excep
tion message: Timeout getting device list.
2016-03-08 11:06:57 [SDR.printStream] [03103a11d0238834] STDOUT java.lang.RuntimeException: Timeout getting device list.
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDOUT java.lang.RuntimeException: Timeout getting device list.
2016-03-08 11:06:57 [SDR.printStream] [03103a11d0238834] STDOUT at com.squareup.spoon.SpoonUtils.waitForAdb(SpoonUtils.java:143)
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDOUT at com.squareup.spoon.SpoonUtils.waitForAdb(SpoonUtils.java:143)
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDOUT at com.squareup.spoon.SpoonUtils.initAdb(SpoonUtils.java:104)
2016-03-08 11:06:57 [SDR.printStream] [03103a11d0238834] STDOUT at com.squareup.spoon.SpoonUtils.initAdb(SpoonUtils.java:104)
2016-03-08 11:06:57 [SDR.printStream] [03103a11d0238834] STDOUT at com.squareup.spoon.SpoonDeviceRunner.main(SpoonDeviceRunner.java:452
)
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDOUT at com.squareup.spoon.SpoonDeviceRunner.main(SpoonDeviceRunner.java:452
)
2016-03-08 11:06:57 [SDR.printStream] [01498AC603012008] STDERR Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
2016-03-08 11:06:57 [SDR.runInNewProcess] Process.waitFor() finished for [01498AC603012008] with exitCode 1
...
このエラーのこちらに解決方法が載ってました。
adbTimeout
を設定すれば良いようです!
app/build.gradle
spoon {
debug = true
adbTimeout = 60 //秒 【この行を追加する】
}