Skip to content

Commit 888208c

Browse files
authored
Disallow flutter run-ing on 32-bit development devices (flutter#97339)
1 parent b3d1f71 commit 888208c

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

packages/flutter_tools/lib/src/ios/devices.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ class IOSDevice extends Device {
302302
}
303303

304304
@override
305-
bool isSupported() => true;
305+
// 32-bit devices are not supported.
306+
bool isSupported() => cpuArchitecture == DarwinArch.arm64;
306307

307308
@override
308309
Future<LaunchResult> startApp(

packages/flutter_tools/test/general.shard/ios/devices_test.dart

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void main() {
6464
});
6565

6666
testWithoutContext('successfully instantiates on Mac OS', () {
67-
IOSDevice(
67+
final IOSDevice device = IOSDevice(
6868
'device-123',
6969
iProxy: IProxy.test(logger: logger, processManager: FakeProcessManager.any()),
7070
fileSystem: fileSystem,
@@ -77,6 +77,23 @@ void main() {
7777
cpuArchitecture: DarwinArch.arm64,
7878
interfaceType: IOSDeviceConnectionInterface.usb,
7979
);
80+
expect(device.isSupported(), isTrue);
81+
});
82+
83+
testWithoutContext('32-bit devices are unsupported', () {
84+
final IOSDevice device = IOSDevice(
85+
'device-123',
86+
iProxy: IProxy.test(logger: logger, processManager: FakeProcessManager.any()),
87+
fileSystem: fileSystem,
88+
logger: logger,
89+
platform: macPlatform,
90+
iosDeploy: iosDeploy,
91+
iMobileDevice: iMobileDevice,
92+
name: 'iPhone 1',
93+
cpuArchitecture: DarwinArch.armv7,
94+
interfaceType: IOSDeviceConnectionInterface.usb,
95+
);
96+
expect(device.isSupported(), isFalse);
8097
});
8198

8299
testWithoutContext('parses major version', () {

0 commit comments

Comments
 (0)