gpt4 book ai didi

java - 使用 connectedInstrumentTest 构建 Android 作业不适用于 Jenkins

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:14:13 26 4
gpt4 key购买 nike

我已将 Jenkins 构建配置为构建 gradle 项目并对其运行测试(使用 connectedInstrumentTest),但构建在启动后数秒后失败。

堆栈跟踪:

com.android.ddmlib.InstallException at com.android.ddmlib.Device.installPackage(Device.java:884) at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:686) at com.android.ddmlib.SyncService.doPushFile(SyncService.java:695) at com.android.ddmlib.SyncService.pushFile(SyncService.java:380) at com.android.ddmlib.Device.syncPackageToDevice(Device.java:906) at com.android.ddmlib.Device.installPackage(Device.java:875) ... 9 more

com.android.builder.testing.ConnectedDevice > runTests[sdk - 4.4.2] [31mFAILED [0m

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:81)

null com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:81) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97) at com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: com.android.ddmlib.InstallException at com.android.ddmlib.Device.installPackage(Device.java:884) at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78) ... 8 more Caused by: com.android.ddmlib.TimeoutException at com.android.ddmlib.AdbHelper.read(AdbHelper.java:686) at com.android.ddmlib.SyncService.doPushFile(SyncService.java:695) at com.android.ddmlib.SyncService.pushFile(SyncService.java:380) at com.android.ddmlib.Device.syncPackageToDevice(Device.java:906) at com.android.ddmlib.Device.installPackage(Device.java:875) ... 9 more :MobileShowcaseApp:connectedInstrumentTest FAILED

我更改了模拟器配置,它有帮助 - 它可以连接到新创建的设备,但是当测试重新运行时,设备异常再次抛出(重新安装 SDK,gradle 没有工作)。

最佳答案

如果我能看到你的系统会更好,但这在我安装 http://blog.zuehlke.com/configure-your-android-project-on-jenkins/ 时对我有帮助

这应该可以正常工作。试试这个。一切顺利!!

关于java - 使用 connectedInstrumentTest 构建 Android 作业不适用于 Jenkins,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21927221/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com