← Back to list
Example: Swift Package that Uses UIKit (macOS

xcb-config
by jcfontecha
⭐ 2🍴 0📅 Jan 2, 2026
SKILL.md
name: xcb-config description: Configure xcb.json to map Xcode schemes to workspaces/projects for building with xcb
xcb Configuration Guide
xcb is a CLI wrapper around xcodebuild. The xcb.json file maps scheme names to their containers (workspace, project, or Swift package).
Config Structure
{
"version": 1,
"open": {
"defaultTarget": "app",
"aliases": {
"demo": "demo-app",
"kit": "packages"
}
},
"builds": [
{
"id": "optional-identifier",
"scheme": "SchemeName",
"workspace": "Path/To/App.xcworkspace",
"destination": "platform=iOS Simulator,name=iPhone 15",
"configuration": "Debug"
}
]
}
Build Entry Fields
| Field | Required | Description |
|---|---|---|
scheme | Yes | Xcode scheme name (must match exactly) |
workspace | One of these | Path to .xcworkspace file |
project | required | Path to .xcodeproj file |
packageDir | Path to Swift package directory | |
id | No | Identifier for the build entry |
destination | No | xcodebuild destination string |
configuration | No | Build configuration (Debug/Release) |
sdk | No | SDK name (iphonesimulator, iphoneos, macosx) |
Open Shortcuts
If your repo has multiple Xcode containers, configure which one xcb open should use:
{
"open": {
"defaultTarget": "app",
"aliases": {
"demo": "demo-app",
"kit": "packages"
}
}
}
open.defaultTargetpoints to a build entry byid(preferred) or byscheme.open.aliasesmaps short names to build entryid(or scheme).
Then:
xcb open # opens defaultTarget
xcb open demo # opens aliases.demo
Common Destinations
- iOS Simulator:
"platform=iOS Simulator,name=iPhone 15" - Generic iOS:
"generic/platform=iOS" - macOS:
"platform=macOS" - watchOS Simulator:
"platform=watchOS Simulator,name=Apple Watch Series 9 (45mm)"
How to Configure
- Run
xcb schemesto list available schemes from the workspace/project - For each scheme you want to build, add a build entry with:
- The exact
schemename - The
workspaceorprojectpath containing that scheme - Optional
destinationandconfiguration
- The exact
Example: App with SPM Dependencies
{
"version": 1,
"builds": [
{
"id": "app",
"scheme": "MyApp",
"workspace": "MyApp.xcworkspace",
"destination": "platform=iOS Simulator,name=iPhone 15",
"configuration": "Debug"
},
{
"id": "tests",
"scheme": "MyAppTests",
"workspace": "MyApp.xcworkspace",
"destination": "platform=iOS Simulator,name=iPhone 15",
"configuration": "Debug"
}
]
}
Example: Swift Package
{
"version": 1,
"builds": [
{
"scheme": "MyLibrary",
"packageDir": ".",
"destination": "generic/platform=iOS"
}
]
}
Example: Swift Package that Uses UIKit (macOS swift build will fail)
If any package targets import UIKit, do not rely on swift build on macOS. Use an iOS Simulator destination in xcb.json:
{
"version": 1,
"builds": [
{
"id": "uikit-package",
"scheme": "MyUIKitPackage",
"packageDir": ".",
"destination": "platform=iOS Simulator,name=iPhone 15",
"configuration": "Debug"
}
]
}
Notes:
xcbwill auto-generate a.xcodeprojfor the package if needed.- If you explicitly pass
--destinationor--sdk, those override defaults.
Usage After Configuration
xcb MyApp # Build the MyApp scheme
xcb MyAppTests # Build the test scheme
xcb schemes # List all available schemes
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon