diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index f9906a027bd..2543383c025 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -54,15 +54,12 @@ class GenSnapshot { ...additionalArgs, ]; - final String snapshotterPath = getSnapshotterPath(snapshotType); + String snapshotterPath = getSnapshotterPath(snapshotType); - // iOS gen_snapshot is a multi-arch binary. Running as an i386 binary will - // generate armv7 code. Running as an x86_64 binary will generate arm64 - // code. /usr/bin/arch can be used to run binaries with the specified - // architecture. + // iOS has a separate gen_snapshot for armv7 and arm64 in the same, + // directory. So we need to select the right one. if (snapshotType.platform == TargetPlatform.ios) { - final String hostArch = iosArch == IOSArch.armv7 ? '-i386' : '-x86_64'; - return runCommandAndStreamOutput(['/usr/bin/arch', hostArch, snapshotterPath, ...args]); + snapshotterPath += '_' + getNameForIOSArch(iosArch); } StringConverter outputFilter;