use of com.android.tools.build.bundletool.testing.FakeAdbServer in project bundletool by google.
the class BuildApksConnectedDeviceTest method connectedDeviceMips_bundleTargetsX86_throws.
@Test
public void connectedDeviceMips_bundleTargetsX86_throws() throws Exception {
fakeAdbServer = new FakeAdbServer(/* hasInitialDeviceList= */
true, ImmutableList.of(FakeDevice.fromDeviceSpec("id1", DeviceState.ONLINE, mergeSpecs(sdkVersion(/* Lollipop */
21), abis("mips"), locales("en-US"), density(DensityAlias.XHDPI)))));
bundleSerializer.writeToDisk(createX86AppBundle(), bundlePath);
BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setGenerateOnlyForConnectedDevice(true).setAdbPath(sdkDirPath.resolve("platform-tools").resolve("adb")).setAdbServer(fakeAdbServer).build();
Throwable exception = assertThrows(IncompatibleDeviceException.class, command::execute);
assertThat(exception).hasMessageThat().contains("The app doesn't support ABI architectures of the device. Device ABIs: [mips], " + "app ABIs: [x86]");
}
use of com.android.tools.build.bundletool.testing.FakeAdbServer in project bundletool by google.
the class BuildApksConnectedDeviceTest method connectedDeviceL_bundleTargetsPreL_throws.
@Test
public void connectedDeviceL_bundleTargetsPreL_throws() throws Exception {
bundleSerializer.writeToDisk(createMaxSdkBundle(/* KitKat */
19), bundlePath);
fakeAdbServer = new FakeAdbServer(/* hasInitialDeviceList= */
true, ImmutableList.of(FakeDevice.fromDeviceSpec("id1", DeviceState.ONLINE, lDeviceWithDensity(DensityAlias.XHDPI))));
BuildApksCommand command = BuildApksCommand.builder().setBundlePath(bundlePath).setOutputFile(outputFilePath).setGenerateOnlyForConnectedDevice(true).setAdbPath(sdkDirPath.resolve("platform-tools").resolve("adb")).setAdbServer(fakeAdbServer).build();
Throwable exception = assertThrows(IncompatibleDeviceException.class, command::execute);
assertThat(exception).hasMessageThat().contains("App Bundle targets pre-L devices, but the device has SDK version " + "higher or equal to L.");
}
Aggregations