Skip to content

Commit c9f2789

Browse files
committed
docs: clarify physical device signing help
1 parent 6247a3d commit c9f2789

3 files changed

Lines changed: 71 additions & 7 deletions

File tree

src/utils/__tests__/args.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ test('usage includes agent workflows, config, environment, and examples footers'
972972
usageText,
973973
/help react-devtools\s+React Native performance, profiling, component tree, and renders/,
974974
);
975+
assert.match(
976+
usageText,
977+
/help physical-device\s+Connected phone\/tablet setup and iOS signing prerequisites/,
978+
);
975979
assert.match(
976980
usageText,
977981
/help react-native\s+React Native app automation hazards, overlays, Metro, and routing/,
@@ -1120,6 +1124,27 @@ test('usageForCommand resolves remote help topic', () => {
11201124
assert.match(help, /Script flow, per-command config/);
11211125
assert.match(help, /same --remote-config to every operational command/);
11221126
assert.match(help, /install-from-source --github-actions-artifact org\/repo:artifact/);
1127+
assert.match(
1128+
help,
1129+
/For connected phone\/tablet setup and iOS signing prerequisites, read agent-device help physical-device/,
1130+
);
1131+
});
1132+
1133+
test('usageForCommand resolves physical-device help topic', () => {
1134+
const help = usageForCommand('physical-device');
1135+
if (help === null) throw new Error('Expected physical-device help text');
1136+
assert.match(help, /agent-device help physical-device/);
1137+
assert.match(help, /connected hardware instead of a simulator\/emulator/);
1138+
assert.match(help, /iOS physical-device prerequisites:/);
1139+
assert.match(help, /Start with Automatic Signing and only these env vars/);
1140+
assert.match(help, /AGENT_DEVICE_IOS_TEAM_ID=ABCDE12345/);
1141+
assert.match(help, /AGENT_DEVICE_IOS_BUNDLE_ID=com\.yourname\.agentdevice\.runner/);
1142+
assert.match(help, /security find-identity -v -p codesigning/);
1143+
assert.match(help, /profile name\/specifier, not a file path/);
1144+
assert.match(help, /AGENT_DEVICE_IOS_SIGNING_IDENTITY is optional; omit it/);
1145+
assert.match(help, /AGENT_DEVICE_IOS_BUNDLE_ID and <id>\.uitests/);
1146+
assert.match(help, /Android physical-device prerequisites:/);
1147+
assert.match(help, /Android does not need the iOS runner signing setup/);
11231148
});
11241149

11251150
test('usageForCommand resolves macos help topic', () => {

src/utils/cli-help.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const AGENT_WORKFLOWS = [
2020
label: 'help react-devtools',
2121
description: 'React Native performance, profiling, component tree, and renders',
2222
},
23+
{
24+
label: 'help physical-device',
25+
description: 'Connected phone/tablet setup and iOS signing prerequisites',
26+
},
2327
{
2428
label: 'help remote',
2529
description: 'Remote/cloud config, tenants, leases, and local service tunnels',
@@ -406,6 +410,36 @@ Slow-flow investigation:
406410
For 15-20s async work, use wait with the exact expected text or selector instead of repeated snapshots.
407411
Report React render offenders separately from network/backend waits and device frame/CPU/memory findings.`,
408412
},
413+
'physical-device': {
414+
summary: 'Connected phone/tablet setup and iOS signing prerequisites',
415+
body: `agent-device help physical-device
416+
417+
Use this when the target is connected hardware instead of a simulator/emulator.
418+
For simulator/emulator workflows, use help workflow.
419+
420+
Discovery:
421+
agent-device devices --platform ios
422+
agent-device devices --platform android
423+
Use --device <name-or-udid> only when multiple devices are present.
424+
425+
iOS physical-device prerequisites:
426+
Xcode and xcrun devicectl must be available from the selected Xcode.
427+
The device must be paired/trusted, connected, unlocked when needed, and have Developer Mode enabled.
428+
The AgentDeviceRunner XCTest host must be signed before commands can run on a physical device.
429+
Start with Automatic Signing and only these env vars:
430+
AGENT_DEVICE_IOS_TEAM_ID=ABCDE12345
431+
AGENT_DEVICE_IOS_BUNDLE_ID=com.yourname.agentdevice.runner
432+
Find team ids and Apple Development signing certificates with:
433+
security find-identity -v -p codesigning
434+
If Xcode cannot choose a profile, set AGENT_DEVICE_IOS_PROVISIONING_PROFILE to the profile name/specifier, not a file path.
435+
AGENT_DEVICE_IOS_SIGNING_IDENTITY is optional; omit it unless xcodebuild asks for a specific identity.
436+
The profile/team must allow AGENT_DEVICE_IOS_BUNDLE_ID and <id>.uitests.
437+
First-run XCTest setup/build can take longer than normal commands; keep the device connected and use --debug to inspect signing/build diagnostics if setup times out.
438+
439+
Android physical-device prerequisites:
440+
Enable USB debugging and confirm the device appears in agent-device devices --platform android.
441+
Android does not need the iOS runner signing setup. For React Native/Expo Metro reachability, read help react-native.`,
442+
},
409443
remote: {
410444
summary: 'Remote config, tenant, lease, and remote host flow',
411445
body: `agent-device help remote
@@ -436,6 +470,7 @@ Rules:
436470
For self-contained scripts, pass the same --remote-config to every operational command, including disconnect; a preceding connect is optional but not required.
437471
For remote artifact installs, use install-from-source <url> or install-from-source --github-actions-artifact org/repo:artifact; do not download CI artifacts locally first.
438472
After connect, let the active remote connection supply runtime hints.
473+
For connected phone/tablet setup and iOS signing prerequisites, read agent-device help physical-device.
439474
For remote Android and iOS bridge React DevTools, run agent-device react-devtools normally. The CLI opens the needed local service tunnel for the DevTools daemon and keeps it alive until agent-device react-devtools stop or disconnect.
440475
Use --debug when remote connection or transport errors need diagnostic ids and remote log hints.`,
441476
},

website/docs/docs/commands.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -811,17 +811,21 @@ agent-device session list --json
811811
- `session list` shows active daemon sessions and their tracked device/app context.
812812
- Use `--json` when you want to inspect or script against the raw session metadata.
813813

814-
## iOS device prerequisites
814+
## iOS physical-device prerequisites
815+
816+
For CLI-discoverable setup guidance, run `agent-device help physical-device`.
815817

816818
- Xcode + `xcrun devicectl` available.
817-
- Paired physical device with Developer Mode enabled.
818-
- Use Automatic Signing in Xcode, or pass optional env overrides:
819+
- Paired/trusted physical device, connected, unlocked when needed, with Developer Mode enabled.
820+
- The `AgentDeviceRunner` XCTest host must be signed before commands can run on a physical device.
821+
- Start with Automatic Signing and only these env vars:
819822
- `AGENT_DEVICE_IOS_TEAM_ID`
820-
- `AGENT_DEVICE_IOS_SIGNING_IDENTITY` (optional)
821-
- `AGENT_DEVICE_IOS_PROVISIONING_PROFILE`
822823
- `AGENT_DEVICE_IOS_BUNDLE_ID` (runner bundle-id base; tests use `<id>.uitests`)
823-
- Free Apple Developer (Personal Team) accounts can fail on unavailable generic bundle IDs; set `AGENT_DEVICE_IOS_BUNDLE_ID` to a unique reverse-DNS value.
824-
- First-run XCTest setup/build can take longer than normal commands; keep the device connected and inspect daemon diagnostics if setup times out.
824+
- Find team ids and Apple Development signing certificates with `security find-identity -v -p codesigning`.
825+
- If Xcode cannot choose a profile, set `AGENT_DEVICE_IOS_PROVISIONING_PROFILE` to the profile name/specifier, not a file path.
826+
- `AGENT_DEVICE_IOS_SIGNING_IDENTITY` is optional; omit it unless `xcodebuild` asks for a specific identity.
827+
- The profile/team must allow `AGENT_DEVICE_IOS_BUNDLE_ID` and `<id>.uitests`.
828+
- First-run XCTest setup/build can take longer than normal commands; keep the device connected and use `--debug` to inspect signing/build diagnostics if setup times out.
825829
- If you override the iOS runner derived-data path and also force cleanup, keep `AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH` under the project `.tmp/` directory. Other cleanup override paths are rejected with a recovery hint.
826830
- For daemon startup troubleshooting:
827831
- follow stale metadata hints for `<state-dir>/daemon.json` and `<state-dir>/daemon.lock` (`state-dir` defaults to `~/.agent-device`)

0 commit comments

Comments
 (0)