# Expo Builder Reference

> Expo Builder shared reference: box env.sh, pnpm conventions, SDK 58 pnpm-workspace.yaml, eas.json image pins, testing ladder, autonomy guards, default budgets, evidence contract. Read when another Expo skill points here.

- Skill: `shixuuu/expo-builder-reference` (Agent Skill)
- Install (CLI): `npx get-skill add shixuuu/expo-builder-reference`
- Raw SKILL.md: https://api.skillmd.com/api/skills/shixuuu/expo-builder-reference/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Shixuuu (https://skillmd.com/u/shixuuu)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/shixuuu/expo-builder-reference

---


# Expo Builder reference

> Read `expo-builder-core` first if you haven't this conversation.

Shared tables for the Expo skills. Owner-specific choices (accounts, repos, budgets) live in memory, not here.
## 1. Shell environment
Start every shell with `source /home/box/expo-builder/env.sh`; if missing, write it from the script below. It's idempotent and user-scoped: it installs Node and pnpm under `$HOME/expo-builder` on first use (set `EXPO_BUILDER_NO_BOOTSTRAP=1` to only print the install command). Check: `node -v` (v22.x, ≥22.13), `pnpm -v` (11.27.0), `command -v pnpm` (not `/usr/bin/pnpm`). `eas`, `agent_cli` and `create_launch` are **real executables** in `$EXPO_BUILDER_HOME/bin` (not shell functions), so they work under `timeout` and `xargs`. Bump pins via the weekly routine, then re-source.

```bash
EXPO_BUILDER_HOME="${EXPO_BUILDER_HOME:-$HOME/expo-builder}"
EXPO_BUILDER_NODE_VERSION="${EXPO_BUILDER_NODE_VERSION:-22.23.3}"   # SDK 58 tooling + pnpm 11 need >=22.13 (even major)
EXPO_BUILDER_PNPM_VERSION="${EXPO_BUILDER_PNPM_VERSION:-11.27.0}"   # = pnpm on the EAS sdk-58 images
EXPO_BUILDER_EAS_CLI_VERSION="${EXPO_BUILDER_EAS_CLI_VERSION:-24.11.0}"
EXPO_BUILDER_AGENT_CLI_VERSION="${EXPO_BUILDER_AGENT_CLI_VERSION:-1.0.18}"
EXPO_BUILDER_CREATE_LAUNCH_VERSION="${EXPO_BUILDER_CREATE_LAUNCH_VERSION:-0.4.1}"
export EXPO_BUILDER_HOME EXPO_BUILDER_NODE_VERSION EXPO_BUILDER_PNPM_VERSION \
  EXPO_BUILDER_EAS_CLI_VERSION EXPO_BUILDER_AGENT_CLI_VERSION EXPO_BUILDER_CREATE_LAUNCH_VERSION
_eb_node_dir="$EXPO_BUILDER_HOME/node-v$EXPO_BUILDER_NODE_VERSION"
_eb_bin_dir="$EXPO_BUILDER_HOME/bin"
export COREPACK_HOME="$HOME/.cache/node/corepack"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export pnpm_config_update_notifier=false
_eb_install_node() {
  _eb_arch="$(uname -m)"
  case "$_eb_arch" in x86_64) _eb_arch=x64 ;; aarch64|arm64) _eb_arch=arm64 ;; esac
  _eb_tgz="node-v$EXPO_BUILDER_NODE_VERSION-linux-$_eb_arch.tar.gz"
  _eb_url="https://nodejs.org/dist/v$EXPO_BUILDER_NODE_VERSION"
  echo "[expo-builder] installing Node $EXPO_BUILDER_NODE_VERSION into $_eb_node_dir" >&2
  mkdir -p "$EXPO_BUILDER_HOME" && _eb_tmp="$(mktemp -d)" &&
    curl -fsSL "$_eb_url/$_eb_tgz" -o "$_eb_tmp/$_eb_tgz" &&
    curl -fsSL "$_eb_url/SHASUMS256.txt" -o "$_eb_tmp/SHASUMS256.txt" &&
    (cd "$_eb_tmp" && grep " $_eb_tgz\$" SHASUMS256.txt | sha256sum -c - >/dev/null) &&
    tar -xzf "$_eb_tmp/$_eb_tgz" -C "$EXPO_BUILDER_HOME" &&
    mv "$EXPO_BUILDER_HOME/node-v$EXPO_BUILDER_NODE_VERSION-linux-$_eb_arch" "$_eb_node_dir"
  _eb_rc=$?; rm -rf "$_eb_tmp"; return $_eb_rc
}
_eb_install_pnpm() {
  echo "[expo-builder] activating pnpm $EXPO_BUILDER_PNPM_VERSION via corepack" >&2
  "$_eb_node_dir/bin/corepack" enable pnpm &&
    "$_eb_node_dir/bin/corepack" prepare "pnpm@$EXPO_BUILDER_PNPM_VERSION" --activate >/dev/null
}
_eb_write_wrapper() {
  _eb_w="$_eb_bin_dir/$1"
  mkdir -p "$_eb_bin_dir"
  cat > "$_eb_w" <<WRAP
#!/usr/bin/env bash
# Auto-generated by expo-builder/env.sh. Do not edit; edit env.sh instead.
# Real executable wrapper for: pnpm dlx $2@<pinned>
set -euo pipefail
EXPO_BUILDER_HOME="\${EXPO_BUILDER_HOME:-\$HOME/expo-builder}"
EXPO_BUILDER_NODE_VERSION="\${EXPO_BUILDER_NODE_VERSION:-$EXPO_BUILDER_NODE_VERSION}"
_nd="\$EXPO_BUILDER_HOME/node-v\$EXPO_BUILDER_NODE_VERSION"
if [ ! -x "\$_nd/bin/pnpm" ]; then
  if [ -n "\${EXPO_BUILDER_NO_BOOTSTRAP:-}" ]; then
    echo "[expo-builder] toolchain missing; run: unset EXPO_BUILDER_NO_BOOTSTRAP; source \$EXPO_BUILDER_HOME/env.sh" >&2
    exit 127
  fi
  # shellcheck source=/dev/null
  . "\$EXPO_BUILDER_HOME/env.sh" >/dev/null 2>&1 || true
fi
case ":\$PATH:" in *":\$_nd/bin:"*) ;; *) PATH="\$_nd/bin:\$PATH" ;; esac
export PATH
exec pnpm dlx "$2@\${$3:-<pin>}" "\$@"
WRAP
  sed -i "s/<pin>/$(eval echo \$$3)/" "$_eb_w"
  chmod +x "$_eb_w"
}
if [ ! -x "$_eb_node_dir/bin/node" ]; then
  if [ -n "${EXPO_BUILDER_NO_BOOTSTRAP:-}" ]; then
    echo "[expo-builder] Node $EXPO_BUILDER_NODE_VERSION missing. Install: unset EXPO_BUILDER_NO_BOOTSTRAP; source $EXPO_BUILDER_HOME/env.sh" >&2
  else
    _eb_install_node || echo "[expo-builder] Node install failed (network?)" >&2
  fi
fi
for _eb_p in "$_eb_bin_dir" "$_eb_node_dir/bin"; do
  case ":$PATH:" in
    *":$_eb_p:"*) PATH="$_eb_p:$(printf '%s' ":$PATH:" | sed "s#:$_eb_p:#:#g; s#^:##; s#:\$##")" ;;
    *) PATH="$_eb_p:$PATH" ;;
  esac
done
export PATH
if [ -x "$_eb_node_dir/bin/node" ]; then
  if [ ! -e "$_eb_node_dir/bin/pnpm" ] ||
     [ "$(cd "$HOME" && "$_eb_node_dir/bin/pnpm" -v 2>/dev/null)" != "$EXPO_BUILDER_PNPM_VERSION" ]; then
    if [ -n "${EXPO_BUILDER_NO_BOOTSTRAP:-}" ]; then
      echo "[expo-builder] pnpm $EXPO_BUILDER_PNPM_VERSION missing. Install: $_eb_node_dir/bin/corepack enable pnpm && $_eb_node_dir/bin/corepack prepare pnpm@$EXPO_BUILDER_PNPM_VERSION --activate" >&2
    else
      _eb_install_pnpm || echo "[expo-builder] pnpm activation failed" >&2
    fi
  fi
fi
hash -r 2>/dev/null
_eb_write_wrapper eas           eas-cli        EXPO_BUILDER_EAS_CLI_VERSION
_eb_write_wrapper agent_cli     @expo/agent-cli EXPO_BUILDER_AGENT_CLI_VERSION
_eb_write_wrapper create_launch create-launch  EXPO_BUILDER_CREATE_LAUNCH_VERSION
expo_builder_env_check() {
  echo "node $(node -v) ($(command -v node))"
  echo "pnpm $(cd "$HOME" && pnpm -v) ($(command -v pnpm))"
  echo "eas wrapper: $(command -v eas)"
  echo "create_launch wrapper: $(command -v create_launch)"
  case "$(command -v pnpm)" in /usr/bin/pnpm) echo "WARN: system pnpm is first on PATH" ;; esac
  echo "COREPACK_HOME=$COREPACK_HOME"
}
```
## 2. Commands (pnpm, never npm/npx)
- **In a project:** `pnpm install` (`CI=1 pnpm install --frozen-lockfile` mirrors EAS); `pnpm expo <cmd>` (`start`, `install`, `install --check`, `lint`, `export`, `prebuild`, `run:*`); `pnpm exec tsc --noEmit`; `pnpm run <script>`; `pnpm why --depth=10 <pkg>`; `pnpm peers check`.
- **CLIs:** the env.sh wrappers `eas`, `agent_cli`, `create_launch`; anything else `pnpm dlx <pkg>@<exact version>` (e.g. `pnpm dlx expo-doctor@latest`). **No global installs** (`npm i -g`, `pnpm add -g`): the box is shared.
- **Exceptions:** a repo on `package-lock.json`, `yarn.lock` or `bun.lock` keeps that manager (migrating is a PR the owner approves); `npx agent-device@latest …` inside `eas simulator:exec` (EAS host) stays as written.
- **pnpm 11 facts:** `.npmrc` holds only auth/registry, package.json's `pnpm` field is ignored, all settings go in `pnpm-workspace.yaml`; peer mismatches only warn; the linker is isolated by default; unreviewed dependency build scripts fail the install (`ERR_PNPM_IGNORED_BUILDS` → add to `allowBuilds` after checking the script); versions under a day old are skipped while an older one fits (`minimumReleaseAge`; don't disable globally).
## 3. Project files
- `package.json` `"packageManager": "pnpm@11.27.0"` = pnpm on the EAS `sdk-58` images; change it with eas.json `pnpm`.
- `pnpm-workspace.yaml`, committed together with `pnpm-lock.yaml`:
  ```yaml
  # SDK 58 beta only: the RN RC expo@58 expects. Remove at stable (expo-sdk-upgrade).
  overrides:
    react-native: 0.88.0-rc.3  # = node_modules/expo/bundledNativeModules.json "react-native"
  allowBuilds:
    unrs-resolver: true  # eslint-config-expo resolver; frozen installs (EAS) fail without it
  ```
  - Drop `overrides` once `latest` ≥ 58 (`pnpm view expo dist-tags`).
  - Use pnpm's default isolated linker, which Expo supports, and never switch `nodeLinker` away from it, not even as a fallback. If a native library breaks under isolated installs, find duplicates with `pnpm why`, pin them with `overrides`, and report or replace the library.
  - Delete any old `.npmrc` that has `legacy-peer-deps`.
- `.gitignore` covers `.env*` (except `.env.example`), `.env.eas-simulator`, keys, keystores, and the generated `ios/`/`android/` (managed workflow).
- `ios.bundleIdentifier` and `android.package` set explicitly. A static `app.json` stays the base; `app.config.ts` spreads `...config`.
- `ios.infoPlist.ITSAppUsesNonExemptEncryption: false` (EAS warns without it; TestFlight requires the answer). Custom non-exempt encryption → ask first (`true` plus export-compliance paperwork).
- `expo-env.d.ts` exists before `tsc` (`/// <reference types="expo/types" />`; gitignored).
## 4. eas.json and build images
| Use | `ios.image` | `android.image` |
|---|---|---|
| SDK 58 dev/preview | `sdk-58` (Xcode 27.0) | `sdk-58` |
| SDK 58 production/store | `macos-tahoe-26.6-xcode-27.0` | `ubuntu-26.04-jdk-17-ndk-r27b-sdk-58` |
| Xcode 27.1 beta (opt-in, simulator/dev only, never store) | `macos-tahoe-26.6-xcode-27.1` | unchanged |
| SDK 57 projects | `sdk-57` | `sdk-57` |

Never leave SDK 58 on `latest` (SDK 57 image, Xcode 26.6). `sdk-58` iOS **verified** 2026-10-07 (`macos-tahoe-26.6-xcode-27.0`, Xcode 27.0 (27A266a), pnpm 11.27.0); aliases move, so check "Spin up build environment" each run, else pin the full name. Re-check https://docs.expo.dev/build-reference/infrastructure.md on image changes.

```json
{"cli":{"appVersionSource":"remote"},
 "build":{
  "base":{"pnpm":"11.27.0"},
  "development":{"extends":"base","developmentClient":true,"distribution":"internal",
   "ios":{"image":"sdk-58"},"android":{"buildType":"apk","image":"sdk-58"}},
  "development-simulator":{"extends":"base","developmentClient":true,"distribution":"internal",
   "ios":{"simulator":true,"image":"sdk-58"},"android":{"buildType":"apk","image":"sdk-58"}},
  "development-xcode-27-1":{"extends":"development-simulator","ios":{"image":"macos-tahoe-26.6-xcode-27.1"}},
  "preview":{"extends":"base","channel":"preview","distribution":"internal",
   "ios":{"image":"sdk-58"},"android":{"image":"sdk-58"}},
  "production":{"extends":"base","channel":"production",
   "ios":{"image":"macos-tahoe-26.6-xcode-27.0"},"android":{"image":"ubuntu-26.04-jdk-17-ndk-r27b-sdk-58"}}}}
```
Ship **both** dev profiles (`development` for devices, `development-simulator`). EAS picks pnpm from `pnpm-lock.yaml` (`--frozen-lockfile`). No upstream `"cli": {"version": ">= 16.0.1"}`.
## 4a. QR codes and deep links
QR libraries read stdin and **hang** a non-interactive shell: pass the text as an argument, redirect stdin, write a file, pin the version:
```bash
pnpm dlx qrcode@1.5.4 -o devclient-qr.png -w 600 "<text>" </dev/null
```
Dev-client link: `exp+<slug>://…` per `expo-builder-core` (newer CLIs print the equivalent `exp+<slug>://?__expo_url=…`). Without a log, @expo/cli's rule: `exp+` + slug, lowercased, chars outside `A-Za-z0-9+-.` dropped. Expo Go: `exp://<host>`. One QR PNG per link.
## 4b. Testing ladder
1. Web preview: `pnpm expo start --web` + box browser screenshot (fastest, no device).
2. Cloud simulator: `expo-cloud-sim-verify` (iOS/Android, no owner device).
3. Dev build on the owner's device (dev client with Fast Refresh): EAS **ad hoc `development`** build (device registered first) or a **store-signed `development` profile via TestFlight**.
4. Testers: internal `preview` build + `eas update`.
5. TestFlight / internal track, then store: `expo-launch-app` or EAS submit (**release** builds, no dev client; Launch has no build-profile option, so it never gives a dev build).
## 5. Autonomy guards
| Action | Default |
|---|---|
| Read repos, docs, EAS state; edit, lint, test, export, prebuild (never committed) in box clones; `pnpm expo install` | Autonomous |
| Push a branch, open a **draft** PR on allow-listed repos | As the owner decided (never merge) |
| EAS Simulator sessions, simulator/dev builds (no credentials), `eas update` to preview/PR branches, preview `eas deploy` | Autonomous within budget (§6) |
| Signed internal/preview builds, `eas init`, `credentials:*`, production `env:*`, any `*:delete`, `eas deploy --prod`, `create-launch --json` | Ask first |
| Production `eas update`, `update:republish`, `channel:rollout`/`channel:edit`, `eas submit`, `--auto-submit`, `metadata:push`, store review replies | Ask first, always (draft commands plus rollback) |
| Expo feedback (`submit-expo-feedback`), upstream issues/PRs, Slack posts | Draft for owner approval |
| `billing:*`, `create-launch logout`, printing `.env.eas-simulator`, `~/.expo/state.json`, preview-API URLs or tokens | Never |

**Live edits and dev-client links:** `expo-builder-core` (Builds, spending and live edits).
## 6. Default budgets (the owner sets real numbers; memory overrides these)
- EAS builds: ≤50% of the plan's included builds; reuse, then simulator/dev builds first; ≤1 bot build in flight, ≤2 queued.
- **Cost gate** (`expo-builder-core`) at build time: `eas account:usage --json` → `builds.plan.percentUsed`, `builds.overage.costCents`. Ad hoc iOS builds bake in registered devices: re-read `eas device:list --json` after changes.
- EAS Simulator: ≤6 sessions/day, `--max-duration-minutes 30 --max-idle-time-minutes 10 --tag grok-bot`; always stop sessions.
- Workflows: PR pipeline only on allow-listed repos; skip docs-only PRs. Usage alerts at 50% and 80% of budget.
## 7. Evidence contract
Every "done", PR or report carries: exact commands and exit codes; UI screenshots (box browser for web, cloud sim for iOS/Android) and a recording for motion; EAS links (build, `deviceRunSessionUrl` replay, update group); and what was **not** verified. Can't reproduce or verify → say so. A build/submit fix is untested ("rebuilding") until the **re-run passes**; report the result when it lands.

