使用connectedInstrumentTest构buildAndroid作业不能在Jenkins上工作

我configuration了Jenkins构build来构buildgradle项目并对其运行testing(使用connectedInstrumentTest),但在启动后几秒内构build失败。

堆栈跟踪:

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。在java.util.concurrent.FutureTask.run(FutureTask.java:com.android.builder.internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:40))处的internal.testing.SimpleTestCallable.call(SimpleTestCallable.java:97) (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)引起的: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 )在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615)在java.lang.Thread.run(Thread.java:744)引起:com.android.ddmlib.InstallException在com.android。 ddmlib.Device.installPackage(Device.java:884)at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:78)… 8 more引起:com.android.ddmlib.T imeoutException 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

我改变了模拟器的configuration,它有帮助 – 它可以连接到新创build的设备,但是当testing重新运行时,设备exception再次抛出(重新安装SDK,gradle不起作用)。

Solutions Collecting From Web of "使用connectedInstrumentTest构buildAndroid作业不能在Jenkins上工作"