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

时间:2014-02-21 06:46:04

标签: java android jenkins android-emulator android-gradle

我已经配置了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)     在   com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97)     在   com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40)     在java.util.concurrent.FutureTask.run(FutureTask.java:262)at   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)     在java.util.concurrent.FutureTask.run(FutureTask.java:262)at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:744)引起:   com.android.ddmlib.TimeoutException at   com.android.ddmlib.AdbHelper.read(AdbHelper.java:686)at 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 at   com.android.ddmlib.Device.installPackage(Device.java:875)... 9更多

     

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)     在   com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97)     在   com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40)     在java.util.concurrent.FutureTask.run(FutureTask.java:262)at   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)     在java.util.concurrent.FutureTask.run(FutureTask.java:262)at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:615)     在java.lang.Thread.run(Thread.java:744)引起:   com.android.ddmlib.InstallException at   com.android.ddmlib.Device.installPackage(Device.java:884)at   com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78)     ... 8更多引起:com.android.ddmlib.TimeoutException at   com.android.ddmlib.AdbHelper.read(AdbHelper.java:686)at 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 at   com.android.ddmlib.Device.installPackage(Device.java:875)...还有9个   :MobileShowcaseApp:connectedInstrumentTest FAILED

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

1 个答案:

答案 0 :(得分:1)

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

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