Xcode 27 now accepts arm-only macOS binaries in the AppStore.
Flutter should introduce a feature flag flutter config --enable-macos-arm64-only. This flag will start as defaulting to false.
See example feature flags:
https://github.com/flutter/flutter/blob/e228771afe936c4aa460faf991b520be18c88bdd/packages/flutter_tools/lib/src/features.dart
When enable-macos-arm64-only is enabled, the target build destination should specify the architecture to arm64:
|
final String destination; |
|
if (buildInfo.isDebug) { |
|
// Debug builds default to current host architecture |
|
destination = 'platform=${XcodeSdk.MacOSX.displayName},arch=$arch'; |
|
} else { |
|
// Release builds default to universal binary |
|
destination = XcodeSdk.MacOSX.genericPlatform; |
|
} |
When the following criteria are met, we should print a warning that a future version of Flutter will default to arm-only and they can opt in by enabling the feature flag.
Criteria for warning:
- When using Xcode 27
- When targeting generic platform
- When x86_64 isn't already in EXCLUDED_ARCHS
- enable-macos-arm64-only is disabled
- Targeting release mode
|
final String destination; |
|
if (buildInfo.isDebug) { |
|
// Debug builds default to current host architecture |
|
destination = 'platform=${XcodeSdk.MacOSX.displayName},arch=$arch'; |
|
} else { |
|
// Release builds default to universal binary |
|
destination = XcodeSdk.MacOSX.genericPlatform; |
|
} |
|
|
|
// Get EXCLUDED_ARCHS from Xcode project build settings |
|
// This allows developers to exclude specific architectures (e.g., x86_64) |
|
// when dependencies don't support them |
|
final String? excludedArches = buildSettings['EXCLUDED_ARCHS']; |
Draft warning:
Xcode 27 no longer requires macOS binaries to support the x86_64 architecture. To build ARM-only macOS apps now, run: "flutter config --enable-macos-arm64-only". This will become the default behavior in a future Flutter release.
Xcode 27 now accepts arm-only macOS binaries in the AppStore.
Flutter should introduce a feature flag
flutter config --enable-macos-arm64-only. This flag will start as defaulting to false.See example feature flags:
https://github.com/flutter/flutter/blob/e228771afe936c4aa460faf991b520be18c88bdd/packages/flutter_tools/lib/src/features.dart
When
enable-macos-arm64-onlyis enabled, the target build destination should specify the architecture toarm64:flutter/packages/flutter_tools/lib/src/macos/build_macos.dart
Lines 213 to 220 in e228771
When the following criteria are met, we should print a warning that a future version of Flutter will default to arm-only and they can opt in by enabling the feature flag.
Criteria for warning:
flutter/packages/flutter_tools/lib/src/macos/build_macos.dart
Lines 213 to 225 in e228771
Draft warning: