Disallow flutter run-ing on 32-bit development devices (#97339)

This commit is contained in:
Jenn Magder
2022-04-12 14:39:07 -07:00
committed by GitHub
parent b3d1f71d5d
commit 888208c1f4
2 changed files with 20 additions and 2 deletions

View File

@@ -302,7 +302,8 @@ class IOSDevice extends Device {
}
@override
bool isSupported() => true;
// 32-bit devices are not supported.
bool isSupported() => cpuArchitecture == DarwinArch.arm64;
@override
Future<LaunchResult> startApp(

View File

@@ -64,7 +64,7 @@ void main() {
});
testWithoutContext('successfully instantiates on Mac OS', () {
IOSDevice(
final IOSDevice device = IOSDevice(
'device-123',
iProxy: IProxy.test(logger: logger, processManager: FakeProcessManager.any()),
fileSystem: fileSystem,
@@ -77,6 +77,23 @@ void main() {
cpuArchitecture: DarwinArch.arm64,
interfaceType: IOSDeviceConnectionInterface.usb,
);
expect(device.isSupported(), isTrue);
});
testWithoutContext('32-bit devices are unsupported', () {
final IOSDevice device = IOSDevice(
'device-123',
iProxy: IProxy.test(logger: logger, processManager: FakeProcessManager.any()),
fileSystem: fileSystem,
logger: logger,
platform: macPlatform,
iosDeploy: iosDeploy,
iMobileDevice: iMobileDevice,
name: 'iPhone 1',
cpuArchitecture: DarwinArch.armv7,
interfaceType: IOSDeviceConnectionInterface.usb,
);
expect(device.isSupported(), isFalse);
});
testWithoutContext('parses major version', () {