Skip to content

feat(apple): 更新 iOS/macOS 项目配置,集成 CocoaPods - #285

Open
Ksuserkqy wants to merge 1 commit into
developfrom
KsuserKqy/apple-devicce-settings-update
Open

feat(apple): 更新 iOS/macOS 项目配置,集成 CocoaPods#285
Ksuserkqy wants to merge 1 commit into
developfrom
KsuserKqy/apple-devicce-settings-update

Conversation

@Ksuserkqy

Copy link
Copy Markdown
Collaborator

Summary

  • iOS/macOS 两端集成 CocoaPods,添加 Pods 相关框架引用和 xcconfig 配置
  • macOS App 产品名从 sspu_allinone 统一改为 SSPU-AllinOne
  • macOS Podfile.lock 移除未使用的插件依赖(screen_retriever、tray_manager 等)
  • macOS Info.plist 添加 LSApplicationCategoryType 分类
  • Xcode scheme 添加 Flutter Framework Prepare 预构建脚本

Test plan

  • iOS pod install 正常运行
  • macOS pod install 正常运行
  • iOS 构建成功
  • macOS 构建成功

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Ksuserkqy
Ksuserkqy requested a review from Qintsg as a code owner June 12, 2026 07:38
@github-actions github-actions Bot added enhancement 新功能、能力增强或体验优化 needs-issue PR 缺少可关联的 issue,需补充或说明豁免 ios iOS 平台实现、构建或适配相关 macos macOS 平台实现、构建或适配相关 dependencies 依赖升级、锁文件、SDK 或第三方库相关 labels Jun 12, 2026

@Qintsg Qintsg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #285 Code Review

需要修复(阻断)

1. DEVELOPMENT_TEAM 硬编码个人 Team ID

ios/Runner.xcodeproj/project.pbxprojmacos/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.plistpublic.app-category.developer-tools
  • macos/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_allinoneSSPU-AllinOne 统一化 ✓
  • PR 标题格式符合 type(scope): 中文摘要 规范 ✓
  • 目标分支 develop

@Qintsg Qintsg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充行内注释,标注三个关键问题的具体位置。

Comment thread macos/Runner/Info.plist
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>LSApplicationCategoryType</key>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

macOS pbxproj 的所有 build configuration 中同时设置了 INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"。两者不一致,Xcode 构建时 pbxproj 会覆盖此处的值。建议统一为 public.app-category.utilities(与 iOS 端一致)。

Comment thread macos/Podfile.lock
- FlutterMacOS
- window_manager (0.2.0):
- FlutterMacOS

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这 5 个依赖的父包仍在 pubspec.yaml 中声明(shared_preferencesurl_launcherwindow_managertray_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;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

所有 build configuration 都硬编码了 DEVELOPMENT_TEAM = 8LDARH2S3X(个人 Team ID)。提交到共享仓库会导致其他开发者签名异常。建议删除此行或改为 DEVELOPMENT_TEAM = "",让每人本地配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies 依赖升级、锁文件、SDK 或第三方库相关 enhancement 新功能、能力增强或体验优化 ios iOS 平台实现、构建或适配相关 macos macOS 平台实现、构建或适配相关 needs-issue PR 缺少可关联的 issue,需补充或说明豁免

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants