Skip to content

Commit eeac953

Browse files
committed
docs: simplify Android Metro reverse guidance
1 parent 77f486f commit eeac953

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/utils/__tests__/args.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ test('usage includes agent workflows, config, environment, and examples footers'
861861
assert.match(usageText, /agent-facing, token-efficient view for planning and targeting actions/);
862862
assert.match(usageText, /Truncated text\/input preview: expand first with snapshot -s @e12/);
863863
assert.match(usageText, /React Native apps: read help react-native/);
864-
assert.match(usageText, /localhost URL opens with a port auto-ensure adb reverse/);
864+
assert.match(usageText, /localhost URL opens with a port auto-configure host reachability/);
865865
assert.match(usageText, /Expo Go\/dev clients: use the provided URL when given/);
866866
assert.match(usageText, /on iOS prefer open "Expo Go" <url>/);
867867
assert.match(usageText, /Install flows: install\/install-from-source first/);
@@ -968,7 +968,8 @@ test('usageForCommand resolves workflow help topic', () => {
968968
assert.match(help, /provider-native text injection when available/);
969969
assert.match(help, /Do not switch to raw adb, clipboard, or paste as an agent fallback/);
970970
assert.match(help, /if no URL is provided but a target\/app name is provided, open that target/);
971-
assert.match(help, /localhost\/127\.0\.0\.1\/\[::1\] with a port auto-ensure adb reverse/);
971+
assert.match(help, /localhost\/127\.0\.0\.1\/\[::1\] with a port auto-configure/);
972+
assert.match(help, /Manual adb reverse tcp:<port> tcp:<port> is only needed/);
972973
assert.match(help, /do not split clear\/restart/);
973974
assert.match(help, /do not write network log headers/);
974975
assert.match(help, /agent-device open exp:\/\/127\.0\.0\.1:8081 --platform ios/);
@@ -1037,7 +1038,7 @@ test('usageForCommand resolves dogfood help topic', () => {
10371038
assert.match(help, /Static\/on-load issues can use one screenshot/);
10381039
assert.match(help, /React Native warning\/error overlays can be real findings/);
10391040
assert.match(help, /Expo Go\/dev-client shells/);
1040-
assert.match(help, /localhost\/127\.0\.0\.1\/\[::1\] with a port auto-ensure adb reverse/);
1041+
assert.match(help, /direct Android localhost URL opens with a port auto-configure/);
10411042
assert.match(help, /Keep stateful commands serial within the same session/);
10421043
assert.match(help, /prefer agent-device open "Expo Go" <url>/);
10431044
assert.match(help, /dogfood-output\/report\.md/);

src/utils/command-schema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ const AGENT_QUICKSTART_LINES = [
169169
'Anti-pattern: snapshot -i followed by snapshot -i | grep ...; prior refs stay valid until app state changes, and --force-full is the explicit full re-read.',
170170
'Truncated text/input preview: expand first with snapshot -s @e12, not get text.',
171171
'React Native apps: read help react-native for Metro, DevTools routing, and RN-specific blockers; use react-native dismiss-overlay for LogBox/RedBox overlays.',
172-
'Android RN/Expo Metro: direct Android localhost URL opens with a port auto-ensure adb reverse when supported; manual adb reverse tcp:<port> tcp:<port> remains harmless before app launches or unsupported flows.',
172+
'Android RN/Expo Metro: direct Android localhost URL opens with a port auto-configure host reachability.',
173173
'Expo Go/dev clients: use the provided URL when given; on iOS prefer open "Expo Go" <url>; Android URL opens infer the foreground package for logs/perf when possible.',
174174
'Install flows: install/install-from-source first, then open the installed id with --relaunch.',
175175
'Text: fill \'id="field-email"\' "qa@example.com" replaces; type appends after press.',
@@ -349,7 +349,7 @@ React Native dev loop:
349349
agent-device find "Home"
350350
Do not use agent-device reload. Use open --relaunch for native startup reset.
351351
React Native apps: use help react-native for Metro/Fast Refresh, DevTools routing, and RN-specific blockers; use react-native dismiss-overlay for LogBox/RedBox overlays.
352-
Android RN/Expo Metro: direct Android URL opens to localhost/127.0.0.1/[::1] with a port auto-ensure adb reverse when supported; manual adb reverse tcp:<port> tcp:<port> remains harmless before app launches or unsupported flows.
352+
Android RN/Expo Metro: direct Android URL opens to localhost/127.0.0.1/[::1] with a port auto-configure host reachability. Manual adb reverse tcp:<port> tcp:<port> is only needed for app/package launches or unsupported flows where the app cannot reach local Metro.
353353
Expo Go is a host shell. Use a provided project URL instead of inventing a bundle id; if no URL is provided but a target/app name is provided, open that target and do not inspect project files to find one. On iOS, prefer host + URL when the host shell is known because direct URL open can report success while leaving the runner/shell focused; verify with snapshot -i after opening:
354354
agent-device open "Expo Go" exp://127.0.0.1:8081 --platform ios
355355
agent-device snapshot -i --platform ios
@@ -510,7 +510,7 @@ React Native dev loop:
510510
agent-device metro reload
511511
agent-device find "Home"
512512
Do not use agent-device reload. Use open --relaunch for native startup reset.
513-
Android RN/Expo Metro: direct Android URL opens to localhost/127.0.0.1/[::1] with a port auto-ensure adb reverse when supported; manual adb reverse tcp:<port> tcp:<port> remains harmless before app launches or unsupported flows.
513+
Android RN/Expo Metro: direct Android localhost URL opens with a port auto-configure host reachability. For app/package launches, use help react-native if the app cannot reach local Metro.
514514
Expo Go/dev clients are host shells. Use provided project URLs, verify with snapshot -i after opening, and ask instead of inventing app ids or URLs. Help workflow owns the full Expo URL command shapes.
515515
516516
Overlays and busy RN UIs:
@@ -619,7 +619,7 @@ Coverage:
619619
Navigation, forms, empty/error/loading states, offline or retry behavior, permissions, settings, accessibility labels, orientation/keyboard, and obvious performance stalls.
620620
React Native warning/error overlays can be real findings or test blockers. Capture them, use react-native dismiss-overlay if unrelated, re-snapshot, and report them.
621621
Expo Go/dev-client shells: use the provided exp:// or dev-client URL and record whether the shell, project load, or app UI is being tested. On iOS dogfood, prefer agent-device open "Expo Go" <url> when Expo Go is the known shell, then snapshot -i to confirm the project UI rather than the runner splash.
622-
Android RN/Expo Metro: direct Android URL opens to localhost/127.0.0.1/[::1] with a port auto-ensure adb reverse when supported; manual adb reverse tcp:<port> tcp:<port> remains harmless before app launches or unsupported flows.
622+
Android RN/Expo Metro: direct Android localhost URL opens with a port auto-configure host reachability.
623623
Categories: visual, functional, UX, content, performance, diagnostics, permissions, accessibility.
624624
Severity: critical blocks a core flow/data/crashes; high breaks a major feature; medium has friction or workaround; low is polish.
625625

test/skillgym/suites/agent-device-smoke-suite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ const SKILL_GUIDANCE_CASES: Case[] = [
11761176
'Launch context: Expo Go because the user provided an exp:// project URL',
11771177
'Local Metro port: 8082',
11781178
'Project URL: exp://127.0.0.1:8082',
1179-
'Direct Android localhost URL opens auto-ensure adb reverse when supported',
1179+
'Direct Android localhost URL opens auto-configure host reachability',
11801180
'Do not assume every React Native app is Expo; this one is Expo only because an exp:// URL was provided',
11811181
],
11821182
task: 'Plan the commands to open the Android Expo project URL on local Metro port 8082 and verify the app UI with an interactive snapshot.',

website/docs/docs/commands.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ agent-device react-devtools profile report @c5
603603
- Keep using `snapshot`, `press`, `fill`, `logs`, `network`, and `perf` for device/app runtime evidence. Use `react-devtools` for React internals.
604604
- For React Native apps, overlays, Metro/Fast Refresh blockers, and routing to React DevTools or debugging evidence, start with `agent-device help react-native`.
605605
- On Android, use `alert get`, `alert wait <short-ms>`, `alert accept`, and `alert dismiss` for runtime permission prompts and native alerts. On iOS, use the same alert commands for XCTest alerts, app-owned modal popups with native blocking markers, and blocking system dialogs. Do not use `settings permission` to answer a dialog already on screen; reserve it for setup or resetting permission state before a flow.
606-
- React Native development builds can connect to the DevTools daemon on port 8097. For Android emulators or physical devices, run `adb reverse tcp:8097 tcp:8097` if the app cannot reach the host. Direct Android `open` URL targets for local Metro hosts with a port auto-ensure the matching reverse when supported; for app launches or unsupported flows, `adb reverse tcp:8081 tcp:8081` remains harmless.
606+
- React Native development builds can connect to the DevTools daemon on port 8097. For Android emulators or physical devices, run `adb reverse tcp:8097 tcp:8097` if the app cannot reach the host.
607+
- Direct Android `open` URL targets for local Metro hosts with a port auto-configure host reachability. For app/package launches or unsupported flows, run `adb reverse tcp:8081 tcp:8081` if the app cannot reach local Metro.
607608
- For Android and iOS sessions connected through a remote bridge profile, `react-devtools` registers a lease-scoped companion tunnel to the sandbox-local DevTools daemon at `127.0.0.1:8097`. Android bridge profiles use the bridge-owned remote `adb reverse` mapping; iOS bridge profiles use the bridge-owned wildcard Metro host tunnel. The CLI keeps the companion alive until `agent-device react-devtools stop` or `agent-device disconnect`.
608609
- For remote iOS bridge sessions, open the app once to create the bridge session, run `agent-device react-devtools start`, then relaunch the same bundle id with `agent-device open <bundle-id> --platform ios --relaunch` before `wait --connected`. React Native attempts the legacy DevTools websocket during JavaScript startup, so starting DevTools after the first launch can miss that connection attempt.
609610
- Remote bridge React DevTools assumes the React Native-bundled DevTools behavior in React Native 0.83+. Older browser/Chromium DevTools workflows are not assumed to exist inside remote sandboxes. Expo projects should be verified against the SDK's bundled React Native version before relying on this path; this release does not claim a separately verified Expo SDK version.

0 commit comments

Comments
 (0)