Entry point:
AGENTS.mdat the repo root lists all agent docs.
This document records the end-to-end workflow used to build and install Closed Captioner on a physical iPhone. It is written for AI coding agents to reduce repeated troubleshooting in future sessions.
| Item | Value |
|---|---|
| Project type | Native iOS app (SwiftUI) |
| Xcode project | ClosedCaptioner.xcodeproj |
| Scheme | ClosedCaptioner |
| Bundle ID | RaveSociety.ClosedCaptioner |
| Display name | Closed Captioner |
| Development team | 66R936J3XS (RaveSociety) |
| Min iOS | 16.4 |
| Signing | Automatic (CODE_SIGN_STYLE = Automatic) |
| Typical build output | build/DerivedData/Build/Products/Debug-iphoneos/ClosedCaptioner.app |
Required permissions (runtime): Microphone, Speech Recognition.
xcodebuild -version succeeds).security find-identity -v -p codesigning
Expect at least one Apple Development: ... identity.
PLA Update available: You currently don't have access to this membership resource
If the phone runs an iOS version newer than what Xcode has cached, install platform support:
xcodebuild -downloadPlatform iOS
This can take several minutes (~8+ GB for simulator/platform components). Do not assume failure until the command exits.
Run from the repository root:
cd /path/to/ClosedCaptioner
xcodebuild -showdestinations \
-project ClosedCaptioner.xcodeproj \
-scheme ClosedCaptioner
Look for a line like:
{ platform:iOS, arch:arm64, id:XXXXXXXX-..., name:Kai2 }
Also useful:
xcrun devicectl list devices
Record: device name, UDID (id from xcodebuild), and any error: suffix on the destination line.
devicectl states| State | Meaning | Agent action |
|---|---|---|
connected |
Ready | Proceed |
connected (no DDI) |
Missing Developer Disk Image / platform | Run xcodebuild -downloadPlatform iOS |
unavailable |
Not reachable (cable, lock, sleep, network) | Ask human to plug in USB, unlock, wake phone |
Developer Mode disabled |
Dev mode off | Ask human to enable Developer Mode |
Always use both provisioning flags when deploying to a new or changed device:
DEVICE_ID="<udid-from-step-1>"
xcodebuild \
-project ClosedCaptioner.xcodeproj \
-scheme ClosedCaptioner \
-destination "platform=iOS,id=${DEVICE_ID}" \
-configuration Debug \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-derivedDataPath build/DerivedData \
build
| Flag | Purpose |
|---|---|
-allowProvisioningUpdates |
Creates/updates profiles, App ID, certificates via Apple Developer portal |
-allowProvisioningDeviceRegistration |
Registers the connected device on the portal and includes it in the profile |
Session lesson: Building with only -allowProvisioningUpdates (or neither flag) produced a signed .app that failed to install with:
This provisioning profile cannot be installed on this device. (0xe8008012)
Rebuild with -allowProvisioningDeviceRegistration after the device is connected.
APP="build/DerivedData/Build/Products/Debug-iphoneos/ClosedCaptioner.app"
xcrun devicectl device install app \
--device "${DEVICE_ID}" \
"${APP}"
Phone must be unlocked:
xcrun devicectl device process launch \
--device "${DEVICE_ID}" \
RaveSociety.ClosedCaptioner
If launch fails with Locked / device was not, or could not be, unlocked, ask the human to unlock the phone and retry only Step 4 (install already succeeded).
xcrun devicectl device info details --device "${DEVICE_ID}"
Confirm:
developerModeStatus: enabledddiServicesAvailable: truebootState: bootedReplace DEVICE_ID with the UDID from Step 1.
DEVICE_ID="00008150-001468E1016A401C" # example: Kai2
xcodebuild \
-project ClosedCaptioner.xcodeproj \
-scheme ClosedCaptioner \
-destination "platform=iOS,id=${DEVICE_ID}" \
-configuration Debug \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-derivedDataPath build/DerivedData \
build \
&& xcrun devicectl device install app \
--device "${DEVICE_ID}" \
build/DerivedData/Build/Products/Debug-iphoneos/ClosedCaptioner.app \
&& xcrun devicectl device process launch \
--device "${DEVICE_ID}" \
RaveSociety.ClosedCaptioner
Use this table to avoid retry loops. Match the error → apply the fix → change approach.
| Symptom / error | Root cause | Fix | Do not |
|---|---|---|---|
Developer Mode disabled |
Dev Mode off on iPhone | Human enables Developer Mode + restart | Retry build repeatedly without human action |
Timed out waiting for all destinations... |
Device not ready or Dev Mode off | Check destination line for error:; fix that first |
Increase timeout only |
iOS 26.5 is not installed / no DDI |
Missing platform / DDI | xcodebuild -downloadPlatform iOS |
Assume simulator download is unrelated — it fixes device support too |
PLA Update available |
License agreement not accepted | Human accepts agreement at developer.apple.com | Change bundle ID or signing randomly |
No profiles for 'RaveSociety.ClosedCaptioner' |
No provisioning profile yet | Build with -allowProvisioningUpdates |
Commit secrets or disable signing |
Device "Kai2" isn't registered |
UDID not on developer portal | Rebuild with both -allowProvisioningUpdates and -allowProvisioningDeviceRegistration while device is connected |
Reuse old .app from generic iphoneos build |
provisioning profile cannot be installed on this device (0xe8008012) |
Profile lacks this device | Same as above — rebuild with device registration flags | Only run devicectl install again |
CoreDeviceService was unable to locate a device |
Phone disconnected / asleep | USB + unlock + wake; re-run devicectl list devices |
Use stale UDID from a previous session without verifying |
devicectl list shows unavailable |
Wireless pairing down or cable unplugged | Prefer USB; unlock phone | Wait indefinitely without asking human to connect |
Install OK, launch Locked |
Phone locked | Human unlocks; retry launch only | Rebuild entire app |
untrusted developer on phone |
Cert not trusted on device | Settings → General → VPN & Device Management → Trust | Re-sign with a different team without reason |
Build for generic/platform=iOS succeeds but device install fails |
Generic build may not include current device in profile | Always rebuild with explicit -destination platform=iOS,id=... and registration flags |
Install generic-build artifact to a new phone |
flowchart TD
A[Start deploy] --> B{showdestinations lists physical iPhone without error?}
B -->|No| C[Read error on destination line]
C --> C1{Dev Mode / platform / unavailable?}
C1 -->|Dev Mode| H1[Human: enable Developer Mode]
C1 -->|Platform| H2[Run xcodebuild -downloadPlatform iOS]
C1 -->|Unavailable| H3[Human: USB + unlock + trust Mac]
H1 --> B
H2 --> B
H3 --> B
B -->|Yes| D[Build with allowProvisioningUpdates + allowProvisioningDeviceRegistration]
D --> E{BUILD SUCCEEDED?}
E -->|PLA / signing| H4[Human: accept PLA / fix Xcode account]
H4 --> D
E -->|Yes| F[devicectl install app]
F --> G{Install OK?}
G -->|0xe8008012| D
G -->|Yes| I[devicectl process launch]
I --> J{Launch OK?}
J -->|Locked| H5[Human: unlock phone → retry launch]
J -->|Yes| K[Done]
| Command / approach | Result | Lesson |
|---|---|---|
xcodebuild build with device destination, no extra flags |
Timeout / Dev Mode error | Fix device errors before building |
xcodebuild build for generic/platform=iOS only |
Build succeeded | Insufficient for new device install — profile may exclude device |
devicectl install after generic build |
0xe8008012 profile error |
Must rebuild with device registration |
xcodebuild build with only -allowProvisioningUpdates |
Device isn't registered |
Must add -allowProvisioningDeviceRegistration |
devicectl process launch while locked |
FBSOpenApplicationErrorDomain error 7 |
Install can succeed; launch needs unlock |
xcrun devicectl list devices early in session |
Slow; CoreSimulator version warnings | Non-fatal noise; prefer xcodebuild -showdestinations for deploy readiness |
These values may change per machine/device; always re-discover, do not hardcode blindly.
| Item | Session value |
|---|---|
| Xcode | 26.5 (Build 17F42) |
| Target device name | Kai2 |
| Target device UDID | 00008150-001468E1016A401C |
| Device model | iPhone 17 Pro Max (iPhone18,2) |
| Device iOS | 26.5 (23F77) |
| Signing identity | Apple Development: karthikbibireddy@hotmail.com (AX345Z9632) |
| Provisioning profile | iOS Team Provisioning Profile: RaveSociety.ClosedCaptioner |
Before asking the human for help, verify:
xcodebuild -showdestinations shows the target iPhone without an error: fieldsecurity find-identity -v -p codesigning shows a valid Apple Development identity-allowProvisioningUpdates and -allowProvisioningDeviceRegistrationplatform=iOS,id=<udid> (not generic, not simulator).app from the same derived data path as that build0xe8008012, rebuild — do not retry install alone| Doc | Path |
|---|---|
| Agent index | AGENTS.md |
| Project overview | README.md |
| Privacy policy | PrivacyPolicy.md |
Update this file when:
After edits, ensure AGENTS.md still links to this file.