如果有两个Xcode,Flutter如何选择

本文介绍如何通过命令行切换到Xcode 12.5版本,并执行首次启动流程。此过程涉及使用sudo权限选择正确的Xcode应用路径,然后运行xcodebuild命令完成初次设置。
sudo xcode-select --switch /Applications/Xcode12.5.app/Contents/Developer

指定Xcode12.5.app

再执行

sudo xcodebuild -runFirstLaunch 

Flutter 3.38+和 Xcode 16.4+具体兼容性信息,提供的引用中未直接提及。不过从关联内容能够得出一些可能有帮助的信息。 在 Flutter 3.38 方面,有重要更新,例如在 iOS 侧加上了对 UI Scene Lifecycle API 的支持(目前为实验性),官方还提供了迁移命令,对于维护一两年的老项目,可运行 `flutter config --enable-ui-scene-migration` 进行迁移尝试[^1]。同时,Flutter 3.38 修复了在 Android 端退出 Activity 销毁时出现的严重内存泄漏问题(issue #173770),该缺陷自 3.29.0 引入且影响所有 Flutter 应用[^2]。 对于 Xcode 16.4+,有提到 Xcode 16.4+iOS 18.5 模拟器因缺失 `libswiftWebKit.dylib` 闪退问题,解决方案涉及特定路径 `/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/System/Cryptexes/OS/usr/lib/swift` [^3]。 在使用配置方面,当遇到与 Flutter 3 相关的 Xcode 15 问题时,需要添加另一个 pod 脚本来解决,脚本代码如下: ```ruby post_integrate do |installer| compiler_flags_key = 'COMPILER_FLAGS' project_path = 'Pods/Pods.xcodeproj' project = Xcodeproj::Project.open(project_path) project.targets.each do |target| target.build_phases.each do |build_phase| if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) build_phase.files.each do |file| if !file.settings.nil? && file.settings.key?(compiler_flags_key) compiler_flags = file.settings[compiler_flags_key] file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') end end end end end project.save() end ``` 虽然此脚本针对 Xcode 15,但在配置 Xcode 16.4+时或许有一定参考价值[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值