← Back to PRs

#22773: fix(ios): support Xcode 16+ team detection and fix ntohl build error

by brianleach open 2026-02-21 17:09 View on GitHub →
app: ios scripts size: S
## Summary - **`scripts/ios-team-id.sh`**: Xcode 16+/26 no longer writes the `IDEProvisioningTeams` key to `com.apple.dt.Xcode.plist`, causing `ios-configure-signing.sh` to silently fail for any newly signed-in developer account. This adds a provisioning profile fallback (`load_teams_from_xcode_managed_profiles`) and detects when an Apple account is present but no team ID can be resolved, providing actionable guidance instead of a generic error. - **`GatewayConnectionController.swift`**: `ntohl()` is not visible in Swift 6 strict concurrency mode on Xcode 26. Replaced with the equivalent `UInt32(bigEndian:)` which is pure Swift and works across all toolchain versions. - **`.gitignore`**: Added `apps/ios/build/`, `apps/shared/OpenClawKit/build/`, and `Swabble/build/` — Xcode's `xcodebuild` output directories were not covered by the existing `.build/` entries (which only match SwiftPM output). ## Test plan - [ ] Run `scripts/ios-team-id.sh` on Xcode 16+ with a signed-in Apple account — should resolve team ID or show actionable instructions - [ ] Run `scripts/ios-team-id.sh` on Xcode 15 — existing behavior unchanged (IDEProvisioningTeams path still works) - [ ] Build iOS target with Xcode 26 / Swift 6 — `GatewayConnectionController.swift` compiles without error - [ ] Verify `xcodebuild` output in `build/` dirs is ignored by git 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed iOS build compatibility with Xcode 16+ and Swift 6. The PR addresses team detection failure on Xcode 16+ by adding a provisioning profile fallback and improves error messaging. Replaced deprecated `ntohl()` with Swift's `UInt32(bigEndian:)` for Swift 6 compatibility. Added appropriate Xcode build directory entries to `.gitignore`. - **`scripts/ios-team-id.sh`**: Added `load_teams_from_xcode_managed_profiles()` fallback that parses local provisioning profiles when Xcode preferences don't contain team data (Xcode 16+ behavior). Enhanced error messages with actionable guidance when Apple account is present but team ID cannot be resolved. - **`GatewayConnectionController.swift`**: Replaced C function `ntohl()` with native Swift `UInt32(bigEndian:)` to fix compilation under Swift 6 strict concurrency mode. - **`.gitignore`**: Added `xcodebuild` output directories for `apps/ios/build/`, `apps/shared/OpenClawKit/build/`, and `Swabble/build/` (distinct from existing SwiftPM `.build/` patterns). <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with minimal risk - Changes are targeted and well-motivated. The Swift change is a straightforward API replacement that's functionally equivalent. The bash script additions follow existing patterns and add useful fallback logic. The .gitignore entries are standard build artifact patterns. Score is 4 (not 5) due to the complexity of the bash script's provisioning profile parsing logic, which would benefit from manual testing on Xcode 16+. - No files require special attention <sub>Last reviewed commit: 3cdd0c4</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs