flutter run -d chrome
运行没有问题,但 -d macos
会触发以下警告。我使用的是arm64,并且很高兴在开发过程中只针对arm64 进行编译。如何单独针对arm64?
flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-0008299F2229401E }
{ platform:macOS, arch:x86_64, id:00006000-0008299F2229401E }
Building macOS application...
仅针对arm64架构,使用
--dart-define
标志来设置FLUTTER_TARGET_PLATFORM_ARCH
环境变量:
flutter run -d macos --dart-define=FLUTTER_TARGET_PLATFORM_ARCH=arm64
如果您想使其永久化,您可以修改您的
macos/Runner.xcodeproj/project.pbxproj
文件。查找 EXCLUDED_ARCHS
构建设置并将其设置为 x86_64
。