← 返回
开发者工具
中文
Xcode
Avoid common Xcode mistakes — signing issues, build settings traps, and cache corruption fixes.
避免常见的 Xcode 错误——签名问题、构建设置陷阱和缓存损坏修复。
ivangdavila
开发者工具
clawhub
v1.0.0 1 版本 99782.4 Key: 无需
#latest
概述
Signing Issues
- "Automatic" signing still needs team selected — set in Signing & Capabilities
- Provisioning profile mismatch — bundle ID must match exactly, including case
- "No signing certificate" — open Keychain, check certificate is valid and not expired
- Device not registered — add UDID in developer portal, regenerate profile
- CI/CD needs manual signing — automatic doesn't work in headless builds
Derived Data Corruption
- Random build failures after Xcode update — delete
~/Library/Developer/Xcode/DerivedData - "Module not found" but it exists — clean Derived Data, restart Xcode
- Stale cache symptoms — builds work, then fail, then work again
xcodebuild clean not enough — sometimes must delete DerivedData manually
Build Settings Hierarchy
- Project → Target → xcconfig → command line — later overrides earlier
$(inherited) to append not replace — forgetting it removes parent settingsSWIFT_ACTIVE_COMPILATION_CONDITIONS for Swift flags — not OTHER_SWIFT_FLAGSGCC_PREPROCESSOR_DEFINITIONS for Obj-C — add to existing, don't replace
Archive vs Build
- Archive uses Release config by default — build uses Debug
- "Works in simulator, fails in archive" — check Release build settings
- Archive requires valid signing — build doesn't for simulator
SKIP_INSTALL = YES for frameworks — or archive includes them incorrectly
Capabilities and Entitlements
- Capability in Xcode must match entitlements file — out of sync causes crashes
- Push notifications need both — App ID capability AND provisioning profile
- Associated domains needs apple-app-site-association file — hosted on your server
- Keychain sharing needs explicit group — default is just your app
Dependencies
- SPM and CocoaPods can conflict — watch for duplicate symbols
- Pod update vs install —
install uses Podfile.lock, update ignores it - "Framework not found" — check Framework Search Paths, embed vs link
- SPM package resolution fails — delete Package.resolved, reset package caches
Common Fixes
- Build fails with no clear error — check Report Navigator for details
- Simulator stuck —
xcrun simctl shutdown all, then xcrun simctl erase all - Indexing stuck — delete Index folder in DerivedData
- Autocomplete broken — restart Xcode, if persists delete DerivedData
CLI Builds
xcodebuild -showBuildSettings to debug — see resolved values-allowProvisioningUpdates for CI with auto-signing — needs keychain access-destination must be exact — platform=iOS Simulator,name=iPhone 15xcrun altool deprecated — use xcrun notarytool for notarization
版本历史
共 1 个版本
-
v1.0.0
当前
2026-03-28 22:38 安全 安全
安全检测
腾讯云安全 (Sanbu)
安全,无风险
查看报告
🔗 相关推荐
developer-tools
larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68
📥 180,181
developer-tools
steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921
📥 185,799
ai-intelligence
ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358
📥 318,370