Skip to content

Commit f23e978

Browse files
dadachiclaude
andauthored
fix(plugin): walk-app — document iOS simctl-relaunch to reach a local Rails (#107)
Hardens the one rough edge the iOS end-to-end walk exposed: mobile-mcp's plain `mobile_launch_app` points the iOS DEBUG build at its nonexistent compiled default (`https://api.<product>.com`), so screens render but every network call fails. To reach a local Rails the app must be relaunched via `xcrun simctl launch` with the `SIMCTL_CHILD_<PRODUCT>_API_{SCHEME,DOMAIN,PORT}` passthrough (the same env-bridge the generator's visual mode uses). - §2: live-data prereq now spells out "Rails up" AND "app pointed at it", with the Android (host baked at build time) vs iOS (host from launch env) difference. - §3: exact simctl terminate+launch recipe with the env vars and where the values come from (out/<slug>/rails/.env). - §6: the blank-data-screen failure mode now points iOS users at the §3 relaunch. Discovered driving barbershop-queue iOS sign-in → barbershops → reservation queue → swipe-complete (persisted state=completed) on 2026-05-24. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c2f22fe commit f23e978

1 file changed

Lines changed: 36 additions & 6 deletions

File tree

plugin/skills/walk-app/SKILL.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,19 @@ Device readiness:
5656
Device Manager** — don't start it with the CLI `emulator -avd` on this machine
5757
(Android Studio owns adb here). Confirm with `adb devices`.
5858

59-
If the app needs live data past the welcome screen, the generated Rails API must
60-
be running: in `out/<slug>/rails/`, `mise exec -- bin/dev` (after `bundle install`
61-
+ `db:prepare` + `db:seed_fu`).
59+
If the app needs live data past the welcome screen, two things must both be true —
60+
Rails must be **running** and the app must be **pointed at it**:
61+
62+
- **Rails up:** in `out/<slug>/rails/`, `mise exec -- bin/dev` (after `bundle
63+
install` + `db:prepare` + `db:seed_fu`). It binds to the HOST in
64+
`out/<slug>/rails/.env` (a LAN/Wi-Fi IP, not localhost). Seeded login for these
65+
specs is `barber1@example.com` / `password` (renamed per spec).
66+
- **App → that Rails:** Android bakes the API host in at build time (`<PRODUCT>_API_*`
67+
gradle properties), so a normal launch reaches it. **iOS does not** — the DEBUG
68+
build reads its host from process env at launch and otherwise falls back to the
69+
nonexistent `https://api.<product>.com`, so a plain `mobile-mcp` launch renders
70+
screens but every network call silently fails. On iOS you must relaunch with the
71+
env passthrough — see §3.
6272

6373
## 3. Connect mobile-mcp to the device
6474

@@ -67,6 +77,24 @@ Then list installed apps and launch the generated one (match on the project's
6777
display name / PascalCase name) — launching by name via mobile-mcp avoids hunting
6878
for the bundle id / package name.
6979

80+
**iOS + live API:** mobile-mcp's plain launch can't inject the API host, so to reach
81+
a local Rails you must relaunch the app via simctl with the `SIMCTL_CHILD_`
82+
passthrough (the same env-bridge the generator's visual mode uses — see
83+
`src/env-bridge.ts`):
84+
85+
```bash
86+
xcrun simctl terminate booted <bundleId>
87+
SIMCTL_CHILD_<PRODUCT>_API_SCHEME=http \
88+
SIMCTL_CHILD_<PRODUCT>_API_DOMAIN=<HOST from out/<slug>/rails/.env> \
89+
SIMCTL_CHILD_<PRODUCT>_API_PORT=<PORT from out/<slug>/rails/.env> \
90+
xcrun simctl launch booted <bundleId>
91+
```
92+
93+
`<PRODUCT>` is the PascalCase project name upper-cased (e.g. `BARBERSHOPQUEUE`).
94+
`SCHEME` is `http` for LAN dev. mobile-mcp still drives the app via WDA regardless
95+
of how it was launched, so do this relaunch *before* you start tapping into
96+
data-backed screens. Android needs none of this (host baked in at build time).
97+
7098
## 4. Capture and walk
7199

72100
The point of this skill is showing, not narrating:
@@ -95,9 +123,11 @@ The device layer fails in known ways; diagnose, don't just retry:
95123
(Android) Studio isn't running and adb sees no device. Point the user at §2.
96124
- **App not installed** → the build/install step didn't run or failed; fall back to
97125
the recommended `NATIVEAPPTEMPLATE_VISUAL=1` route.
98-
- **App launches but screens are blank / error** → the Rails API likely isn't
99-
running or the app can't reach it; start it (§2) and check the
100-
`NATIVEAPPTEMPLATE_API_*` env the app was built against.
126+
- **App launches but data screens are blank / error (sign-in fails, lists empty)**
127+
→ Rails isn't running, or the app isn't pointed at it. Start Rails (§2); on **iOS**
128+
confirm you relaunched with the `SIMCTL_CHILD_<PRODUCT>_API_*` passthrough (§3) —
129+
a plain mobile-mcp launch hits the nonexistent default host and every call fails
130+
while screens still render.
101131
- **Build fails** → surface the compiler output; Jetpack Compose + Hilt are the
102132
known-cryptic ones. Offer a repair re-run of `generate-app` with
103133
`NATIVEAPPTEMPLATE_REPAIR=on`.

0 commit comments

Comments
 (0)