diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index d47a270a82..b4780a3847 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -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 startApp( diff --git a/packages/flutter_tools/test/general.shard/ios/devices_test.dart b/packages/flutter_tools/test/general.shard/ios/devices_test.dart index 2f7d8ce8e7..9a892ef64d 100644 --- a/packages/flutter_tools/test/general.shard/ios/devices_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/devices_test.dart @@ -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', () {