feat(apple): 更新 iOS/macOS 项目配置,集成 CocoaPods - #285
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Qintsg
left a comment
There was a problem hiding this comment.
PR #285 Code Review
需要修复(阻断)
1. DEVELOPMENT_TEAM 硬编码个人 Team ID
ios/Runner.xcodeproj/project.pbxproj 和 macos/Runner.xcodeproj/project.pbxproj 中所有 build configuration 都写入了 DEVELOPMENT_TEAM = 8LDARH2S3X。这是你的个人 Apple Developer Team ID,提交到共享仓库会导致:
- 其他开发者拉取后 Xcode 报签名错误或自动切换到错误 Team
- 与项目"本地签名配置不提交"的原则冲突(类似
android/key.properties不入库)
建议:删除所有 DEVELOPMENT_TEAM 行,或改为 DEVELOPMENT_TEAM = "",让每位开发者在 Xcode 中本地配置。
2. macOS Podfile.lock 移除了仍在使用的插件原生实现
macos/Podfile.lock 移除了 5 个依赖,但它们的父包仍在 pubspec.yaml 中声明:
| 移除的依赖 | pubspec.yaml 中的包 |
|---|---|
shared_preferences_foundation |
shared_preferences |
url_launcher_macos |
url_launcher |
window_manager |
window_manager |
tray_manager |
tray_manager |
screen_retriever_macos |
window_manager 运行时依赖 |
这些是 Flutter 插件的 macOS 原生实现层。移除后上述插件在 macOS 上会编译失败。CI 跑在 Ubuntu 上不会捕获此问题。
建议:在 macOS 上执行 flutter pub get && cd macos && pod install 重新生成 Podfile.lock,确认这些依赖存在后再提交。
3. macOS LSApplicationCategoryType 值不一致
macos/Runner/Info.plist:public.app-category.developer-toolsmacos/Runner.xcodeproj/project.pbxproj(所有 configuration):INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"
同一属性两个不同值。Xcode 构建时 INFOPLIST_KEY_* 会覆盖 Info.plist 中的同名 key,实际生效的是 utilities。应统一为一个值(建议 utilities,与 iOS 端一致)。
建议改进(非阻断)
- 分支名
KsuserKqy/apple-devicce-settings-update有拼写错误(devicce),不影响合入但建议后续注意 needs-issue标签存在,平台工程变更建议关联 Issue 以便追溯- PR 测试计划全部未勾选,建议在 macOS/iOS 环境实际验证后再标记 Ready for Review
没问题的部分
- iOS
Podfile.lock新增正确,Pods/已被.gitignore排除 ✓ - iOS/macOS scheme 新增 Flutter Framework Prepare 预构建脚本 ✓
- xcconfig 添加
#include?Pods 配置(使用?避免文件不存在时报错)✓ - macOS 产品名
sspu_allinone→SSPU-AllinOne统一化 ✓ - PR 标题格式符合
type(scope): 中文摘要规范 ✓ - 目标分支
develop✓
| <string>MainMenu</string> | ||
| <key>NSPrincipalClass</key> | ||
| <string>NSApplication</string> | ||
| <key>LSApplicationCategoryType</key> |
There was a problem hiding this comment.
macOS pbxproj 的所有 build configuration 中同时设置了 INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"。两者不一致,Xcode 构建时 pbxproj 会覆盖此处的值。建议统一为 public.app-category.utilities(与 iOS 端一致)。
| - FlutterMacOS | ||
| - window_manager (0.2.0): | ||
| - FlutterMacOS | ||
|
|
There was a problem hiding this comment.
这 5 个依赖的父包仍在 pubspec.yaml 中声明(shared_preferences、url_launcher、window_manager、tray_manager),移除后 macOS 上会编译失败。请在 macOS 上执行 flutter pub get && cd macos && pod install 重新生成此文件。
| @@ -590,9 +599,12 @@ | |||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | |||
| CLANG_ENABLE_MODULES = YES; | |||
| CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; | |||
There was a problem hiding this comment.
所有 build configuration 都硬编码了 DEVELOPMENT_TEAM = 8LDARH2S3X(个人 Team ID)。提交到共享仓库会导致其他开发者签名异常。建议删除此行或改为 DEVELOPMENT_TEAM = "",让每人本地配置。
Summary
sspu_allinone统一改为SSPU-AllinOneLSApplicationCategoryType分类Test plan
pod install正常运行pod install正常运行🤖 Generated with Claude Code