Loading...
Loading...
Compare original and translation side by side
| Project Type | Primary Tool | When to Use |
|---|---|---|
Standalone | | Libraries, CLI tools, cross-platform Swift (no .xcodeproj) |
| | CocoaPods or multi-project setups |
| | Standard Xcode projects (including those with SPM dependencies) |
swift buildswift testxcodebuild| 项目类型 | 主要工具 | 使用场景 |
|---|---|---|
独立 | | 库、CLI工具、跨平台Swift项目(无.xcodeproj) |
| | CocoaPods或多项目配置 |
| | 标准Xcode项目(包含SPM依赖的项目) |
swift buildswift testxcodebuildundefinedundefined
**Note**: When an Xcode project references a local Swift package, each package **target** gets its own scheme (named after the target, not the package). Use these schemes to build individual targets without building the entire app.
For mixed projects, shared schemes, or detailed output parsing, see [project-discovery.md](references/project-discovery.md).
**注意**:当Xcode项目引用本地Swift包时,每个包**target**会拥有自己的scheme(以target命名,而非包名)。可使用这些scheme来构建单个target,无需构建整个应用。
对于混合项目、共享scheme或需要解析详细输出的场景,请查看[project-discovery.md](references/project-discovery.md)。| Goal | Command |
|---|---|
| Build (debug) | |
| Build (release) | |
| Run executable | |
| Run tests | |
| Run specific test | |
| Show binary path | |
| Clean | |
| Initialize | |
| 目标 | 命令 |
|---|---|
| 构建(debug模式) | |
| 构建(release模式) | |
| 运行可执行文件 | |
| 运行测试 | |
| 运行指定测试 | |
| 显示二进制文件路径 | |
| 清理 | |
| 初始化 | |
xcodebuild [action] -scheme <name> [-workspace|-project] [options] [BUILD_SETTING=value]| Goal | Command |
|---|---|
| List schemes | |
| Build | |
| Test | |
| Build for testing | |
| Test without build | |
| Archive | |
| Clean | |
-scheme-workspace-project-destinationxcodebuild [action] -scheme <name> [-workspace|-project] [options] [BUILD_SETTING=value]| 目标 | 命令 |
|---|---|
| 列出schemes | |
| 构建 | |
| 测试 | |
| 为测试构建 | |
| 不构建直接测试 | |
| 归档 | |
| 清理 | |
-scheme-workspace-project-destination| Platform | Destination Specifier |
|---|---|
| macOS | |
| iOS Simulator | |
| iOS Device | |
| tvOS Simulator | |
| watchOS Simulator | |
| visionOS Simulator | |
| Generic (build only) | |
xcrun simctl list devices available| 平台 | 目标指定参数 |
|---|---|
| macOS | |
| iOS模拟器 | |
| iOS设备 | |
| tvOS模拟器 | |
| watchOS模拟器 | |
| visionOS模拟器 | |
| 通用(仅构建) | |
xcrun simctl list devices available| Topic | File | When to Read |
|---|---|---|
| Project Discovery | project-discovery.md | Mixed projects, shared schemes |
| Swift Package Manager | swift-package-manager.md | Cross-compilation, Package.swift syntax |
| xcodebuild Basics | xcodebuild-basics.md | Build settings, SDK selection |
| Destinations | destinations.md | All platforms, multiple destinations |
| Testing | testing.md | Test filtering, parallel execution, coverage |
| Archiving | archiving.md | Archive creation |
| Troubleshooting | troubleshooting.md | Build/test failures, error recovery |
| 主题 | 文件 | 阅读场景 |
|---|---|---|
| 项目探索 | project-discovery.md | 混合项目、共享scheme |
| Swift Package Manager | swift-package-manager.md | 交叉编译、Package.swift语法 |
| xcodebuild基础 | xcodebuild-basics.md | 构建设置、SDK选择 |
| 目标配置 | destinations.md | 全平台支持、多目标配置 |
| 测试 | testing.md | 测试过滤、并行执行、覆盖率 |
| 归档 | archiving.md | 归档文件创建 |
| 故障排除 | troubleshooting.md | 构建/测试失败、错误恢复 |
xcodebuild-destination 'generic/platform=iOS'-workspace.xcodeprojxcodebuild -listxcrun simctl list devices availableCODE_SIGNING_ALLOWED=NOxcodebuild-destination 'generic/platform=iOS'-workspace.xcodeprojxcodebuild -listxcrun simctl list devices availableCODE_SIGNING_ALLOWED=NO