Add eas-simulator skill#88
Conversation
95f2749 to
b1e998a
Compare
davidmokos
left a comment
There was a problem hiding this comment.
Review comments based on Anthropic and OpenAI skill-creator guidance.
|
|
||
| ```bash | ||
| # 1. Add a simulator build profile to eas.json | ||
| cat > eas.json <<'JSON' |
There was a problem hiding this comment.
This should not overwrite eas.json. Agents often run skill command blocks as written, so this can delete existing build or submit profiles.
A better way would be to instruct the agent to merge/add a sim profile while preserving existing cli, build, and submit config
| @@ -0,0 +1,145 @@ | |||
| --- | |||
| name: eas-simulator | |||
| description: "Run and control a user's app on a remote iOS/Android simulator hosted on EAS cloud. Always read before executing any `eas simulator:*` commands — it has the current syntax for this experimental API. Use whenever the user needs a simulator they can't run locally — 'run my app on a cloud simulator', 'use eas simulator to run/install/screenshot my app', 'I'm on Linux/Cursor and need an iOS device', 'no sim on this box / headless CI', 'let an agent click through my app and screenshot it', 'test my dev build on a remote sim with live reload', 'stream a sim's screen to my browser' — even when they don't say 'EAS Simulator' or 'cloud'. Covers `eas simulator:*` plus installing a build and a dev-build live-edit loop. On a host WITHOUT a local simulator (Linux, CI, cloud sandbox) it's the default — just use it; on macOS, where a local sim exists, do NOT auto-trigger for a plain 'run on the simulator' — use it only for a cloud/remote/shareable sim, an iOS version they lack, or an agent-driven session. NOT for local sims (expo run:ios, Xcode, Android Studio), EAS Build/Update, web preview, or physical devices." | |||
There was a problem hiding this comment.
This description is 1,115 chars, we should fit into 1,024 chars. Please trim it. Keep the main trigger cases here and move examples or exclusions into the body.
|
|
||
| ⚠️ **Don't install a release build as a "quick interim" and screenshot it** — that interim shows stale, build-time code (the "outdated screenshot" trap). Go straight to the dev build + Metro; screenshot only after the dev client is connected to Metro. | ||
|
|
||
| **No local Mac toolchain?** (the common cloud/Linux case) Build the dev client on **EAS** instead of step 1: add a profile with `{"developmentClient": true, "ios": {"simulator": true}}`, run `npx --yes eas-cli@latest build --platform ios --profile dev-sim`, and in step 3 use `install-from-source <artifact-url>` (VM downloads it) instead of the local `install`. Steps 2 and 4–7 (Metro tunnel + connect) are identical — your edited JS still loads live from your local Metro. |
There was a problem hiding this comment.
I'm confused a little here - Mode C is the default and the main point of cloud simulator is that you can run on non-macOS machine. However, the EAS dev-client path is only a short paragraph even though it's the most important part. Can we expand it a little?
Kudo
left a comment
There was a problem hiding this comment.
would like to know further test plans:
- if we ask agent to use argent, does it work well? (because the skill / references hardcoded agent-device in multiple places)
- if we ask agent to run android workflow, does ti work well? (because the skill / references hardcoded ios in multiple places)
| description: "Run and control a user's app on a remote iOS/Android simulator hosted on EAS cloud. Always read before executing any `eas simulator:*` commands — it has the current syntax for this experimental API. Use whenever the user needs a simulator they can't run locally — 'run my app on a cloud simulator', 'use eas simulator to run/install/screenshot my app', 'I'm on Linux/Cursor and need an iOS device', 'no sim on this box / headless CI', 'let an agent click through my app and screenshot it', 'test my dev build on a remote sim with live reload', 'stream a sim's screen to my browser' — even when they don't say 'EAS Simulator' or 'cloud'. Covers `eas simulator:*` plus installing a build and a dev-build live-edit loop. On a host WITHOUT a local simulator (Linux, CI, cloud sandbox) it's the default — just use it; on macOS, where a local sim exists, do NOT auto-trigger for a plain 'run on the simulator' — use it only for a cloud/remote/shareable sim, an iOS version they lack, or an agent-driven session. NOT for local sims (expo run:ios, Xcode, Android Studio), EAS Build/Update, web preview, or physical devices." | ||
| version: 1.0.0 | ||
| license: MIT | ||
| allowed-tools: "Bash(npx *), Bash(eas *), Bash(expo *), Bash(xcodebuild*), Bash(pod*)" |
There was a problem hiding this comment.
can we scope the tools to smaller group? especially the npx * feels dangerous
|
|
||
| ## When to use | ||
|
|
||
| The frontmatter `description` carries the trigger phrases. In short: use this to get a user's app onto a **cloud** simulator and interact with it — especially from a Mac-less or cloud/sandbox agent. **Not** for local sims (`expo run:ios`, Xcode, Android Studio), store builds/signing (that's EAS Build), or physical devices. For the macOS case, see *Cloud vs local* next. |
There was a problem hiding this comment.
i suppose agents will load frontmatter and description before this section?
| ## Cloud vs local: decide this first | ||
|
|
||
| - **Non-macOS** (Linux / CI / cloud sandbox like Cursor Cloud, detect via `uname -s` ≠ `Darwin`): the only way to get a sim — **just proceed.** | ||
| - **macOS:** local sims exist and a cloud session costs money + latency, so **ask first** ("a remote cloud sim — to share a live preview, offload, or test an iOS version you lack — or just run locally?") unless the user explicitly said cloud/remote/shareable. |
There was a problem hiding this comment.
can we run some local script to determine whether local simulator/emulator is available?
e.g. checking simctl or xcodebuild available?
| - **Run every `eas` command via `npx --yes eas-cli@latest …`** — guarantees a CLI new enough to have `simulator:*` (a global `eas` is often too old), and `--yes` skips npx's prompt. (Bare `eas` is fine if `eas --version` is current.) | ||
| - **Authenticated.** Interactive machine → `npx --yes eas-cli@latest login`. **Cloud sandbox / CI / headless agent has no browser login — set `EXPO_TOKEN`** (expo.dev → Account → Access Tokens) in the env instead. Verify either way with `npx --yes eas-cli@latest whoami`. | ||
| - Run from an Expo **project directory.** A fresh app needs one-time setup: `npx --yes eas-cli@latest init` to create/link the project (when there's no `projectId`), and **set `ios.bundleIdentifier`** in app config if it's missing — a fresh `create-expo-app` often has none, and `prebuild`/`eas build` need it (they prompt or fail without it; e.g. `dev.<owner>.<slug>`). Read current config with `npx expo config --json` (it may live in `app.config.js`). The first Mode-C run is slow (native build); later runs reuse it. | ||
| - A controller to drive the device. This skill uses **agent-device** (open source, MIT), run on demand via `npx agent-device@latest` — nothing globally installed. |
There was a problem hiding this comment.
should we mention argent or other alternatives here in Prerequisites?
Why
EAS provides cloud simulators. This skill makes it easy for agents to open in-development apps on them.
What
New skill at
plugins/expo/skills/eas-simulator/— SKILL.md and three reference files. Covers the session lifecycle, three ways to get an app onto the sim, driving it (press, screenshot, etc.), and cleanup.Test plan
Ran all three modes on real sessions from Cursor on a Mac. Opus 4.8, Composer 2.5, and Codex 5.3 all picked up and followed the skill correctly.
Mode A — local release build
Built locally, uploaded to the cloud sim, app rendered.
Transcript
Mode B — EAS build
EAS built it, VM downloaded the artifact (no credentials), app rendered.
Transcript
Mode C — dev build + tunnel (live edit)
Edited a file locally, it hot-reloaded on the remote sim with no rebuild.
Transcript
Trigger accuracy — 6/6 (100%)
Still to do: