|
1
|
# Platform runners |
|
2
|
|
|
3
|
All native runners live in a **single Xcode project**, |
|
4
|
`XCRSControlKitRunner.xcodeproj`, generated from `project.yml` with |
|
5
|
[XcodeGen](https://github.com/yonaskolb/XcodeGen). Each Apple platform has its |
|
6
|
own application and UI-test targets plus a matching scheme, while the transport |
|
7
|
and RPC logic are shared. |
|
8
|
|
|
9
|
```text |
|
10
|
Runners/ |
|
11
|
├── project.yml # XcodeGen spec (source of truth) |
|
12
|
├── XCRSControlKitRunner.xcodeproj # generated; do not hand-edit |
|
13
|
├── Shared/ # transport + RPC server, shared by all targets |
|
14
|
│ ├── ControlKitRPCServer.swift |
|
15
|
│ └── ControlKitRunnerUITests.swift |
|
16
|
├── iOS/ # iOS / iPadOS host app + assets |
|
17
|
├── tvOS/ # tvOS host app + assets |
|
18
|
├── visionOS/ # visionOS host app + assets |
|
19
|
├── macOS/ # macOS host app + assets |
|
20
|
└── watchOS/ # watchOS host app + assets |
|
21
|
``` |
|
22
|
|
|
23
|
## Targets and schemes |
|
24
|
|
|
25
|
| Scheme | App target | UI-test target | Platform | |
|
26
|
|---|---|---|---| |
|
27
|
| `ControlKit-iOS` | `ControlKit-iOS` | `ControlKit-iOS-UITests` | iOS / iPadOS | |
|
28
|
| `ControlKit-tvOS` | `ControlKit-tvOS` | `ControlKit-tvOS-UITests` | tvOS | |
|
29
|
| `ControlKit-visionOS` | `ControlKit-visionOS` | `ControlKit-visionOS-UITests` | visionOS | |
|
30
|
| `ControlKit-macOS` | `ControlKit-macOS` | `ControlKit-macOS-UITests` | macOS | |
|
31
|
| `ControlKit-watchOS` | `ControlKit-watchOS` | `ControlKit-watchOS-UITests` | watchOS | |
|
32
|
|
|
33
|
Each UI-test target compiles the shared `Shared/` sources for its platform, so |
|
34
|
platform behaviour is selected at compile time via `#if os(...)` in |
|
35
|
`ControlKitRPCServer.swift`. Per-platform bundle identifiers, device families, |
|
36
|
app icons, and deployment targets keep signing and packaging independent. |
|
37
|
|
|
38
|
## Regenerating the project |
|
39
|
|
|
40
|
After editing `project.yml` (or adding a platform folder), regenerate: |
|
41
|
|
|
42
|
```sh |
|
43
|
brew install xcodegen # once |
|
44
|
cd Runners |
|
45
|
xcodegen generate |
|
46
|
``` |
|
47
|
|
|
48
|
The generated `.xcodeproj` is committed so contributors without XcodeGen can |
|
49
|
still open and build the runners; only structural changes require regeneration. |