{"slug": "build-system-priority-for-apple-platform-projects", "title": "Build system priority for Apple platform projects", "summary": "A developer outlines a priority system for building Apple platform projects, recommending Xcode MCP Tools when Xcode is open, xcodebuild for CLI builds, and swift build/swift test only as a last resort for pure-Swift packages without resources. The post warns that swift build cannot compile bundled resources like .xcstrings or .xcassets, causing silent test failures.", "body_md": "For any Xcode project or Swift Package Manager package, use this order — pick the first option that fits the situation, do not skip down the list.\n\n-\n**Xcode MCP Tools**— use these when Xcode has the project open. They reuse the running Xcode's build state (no duplicate DerivedData / build caches piling up), and open the door to workflows the CLI cannot reach — running screenshot / snapshot tests through the running IDE, driving simulators the user is already using, etc. -\n— for CLI builds and tests. Compiles bundled resources correctly:`xcodebuild`\n\n`.xcstrings`\n\nstring catalogs become per-locale`.strings`\n\ninside the bundle,`.xcassets`\n\nare compiled, etc. Use this when Xcode is not open or when a headless build is needed. -\n— last resort. Only safe for pure-Swift packages with no resources.`swift build`\n\n/`swift test`\n\n**They cannot resolve bundled resources.** A`.xcstrings`\n\nfile is copied into`Bundle.module`\n\nbut never compiled into per-locale`.strings`\n\n, so at runtime`String(localized:bundle:)`\n\nreturns the raw key and every test that asserts on translated text fails.`.xcassets`\n\nhas the equivalent problem for image lookups. If a Package declares`resources: [.process(\"Resources\")]`\n\nwith anything more than plain data files,`swift test`\n\nwill silently fail resource-dependent tests — reach for`xcodebuild`\n\ninstead.", "url": "https://wpnews.pro/news/build-system-priority-for-apple-platform-projects", "canonical_source": "https://gist.github.com/Kyome22/e4d4b211f7fbbcd1f81f7067489c0f4b", "published_at": "2026-07-18 04:30:15+00:00", "updated_at": "2026-07-18 11:25:54.870725+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Apple", "Xcode", "Swift Package Manager"], "alternates": {"html": "https://wpnews.pro/news/build-system-priority-for-apple-platform-projects", "markdown": "https://wpnews.pro/news/build-system-priority-for-apple-platform-projects.md", "text": "https://wpnews.pro/news/build-system-priority-for-apple-platform-projects.txt", "jsonld": "https://wpnews.pro/news/build-system-priority-for-apple-platform-projects.jsonld"}}