| 1 | # XCRSControlKit |
| 2 | |
| 3 | XCRSControlKit is the shared Swift package contract for black-box automation |
| 4 | of Apple platforms. It provides stable target, capability, and request models |
| 5 | that can be used by native test runners and external automation clients. |
| 6 | |
| 7 | The package is intentionally transport-neutral. Platform runners remain |
| 8 | separate Xcode projects because XCTest and UI testing require platform-specific |
| 9 | schemes, host applications, simulator destinations, signing, and entitlements. |
| 10 | |
| 11 | ## Supported platforms |
| 12 | |
| 13 | - iOS and iPadOS |
| 14 | - tvOS |
| 15 | - watchOS |
| 16 | - visionOS |
| 17 | - macOS |
| 18 | |
| 19 | ## Installation |
| 20 | |
| 21 | Add the package URL to an Xcode project or Swift package: |
| 22 | |
| 23 | ```swift |
| 24 | dependencies: [ |
| 25 | .package(url: "https://github.com/ondeinference/xcrs-controlkit.git", from: "1.0.0") |
| 26 | ] |
| 27 | ``` |
| 28 | |
| 29 | Then import the library: |
| 30 | |
| 31 | ```swift |
| 32 | import XCRSControlKit |
| 33 | |
| 34 | let capabilities = XCRSControlKitCapabilities.standard(for: .tvOS) |
| 35 | if capabilities.supports(.remoteButtons) { |
| 36 | // Connect a tvOS runner and send remote-button requests. |
| 37 | } |
| 38 | ``` |
| 39 | |
| 40 | ## Runner projects |
| 41 | |
| 42 | Runner implementations belong outside the Swift package target. All platforms |
| 43 | share one Xcode project generated with XcodeGen: |
| 44 | |
| 45 | ```text |
| 46 | Runners/ |
| 47 | ├── project.yml # XcodeGen spec |
| 48 | ├── XCRSControlKitRunner.xcodeproj # one project, per-platform targets/schemes |
| 49 | ├── Shared/ # transport + RPC server |
| 50 | ├── iOS/ # iOS / iPadOS host app |
| 51 | ├── tvOS/ # tvOS host app |
| 52 | ├── visionOS/ # visionOS host app |
| 53 | ├── macOS/ # macOS host app |
| 54 | └── watchOS/ # watchOS host app |
| 55 | ``` |
| 56 | |
| 57 | Each platform gets its own application and UI-test targets and a matching |
| 58 | scheme (`ControlKit-iOS`, `ControlKit-tvOS`, `ControlKit-visionOS`, |
| 59 | `ControlKit-macOS`, `ControlKit-watchOS`) while importing `XCRSControlKit` and |
| 60 | sharing the transport. See `Runners/README.md`. |
| 61 | |
| 62 | ## Status |
| 63 | |
| 64 | The package provides the public cross-platform contract. Native ControlKit |
| 65 | runners currently support iOS, iPadOS, tvOS, visionOS, macOS, and watchOS. |
| 66 | |
| 67 | ## License |
| 68 | |
| 69 | XCRSControlKit is available under the Apache License, Version 2.0. |