Remote script. The install command pipes a script from GitHub straight into bash, so read it first or pin a known release before running it.
Who it is forA mobile developer on a Mac with a React Native or Expo app who wants to see iOS and Android builds side by side while coding.
The problemSetting up Metro, simulators, emulators, and native builds for two platforms by hand is slow and easy to get wrong.
The outcomeBoth platforms run the same project in the device pane, with one shared Metro server.
What you need first
- macOS with Xcode for iOS previews
- Node 20 or newer (serve-sim needs it)
- Android SDK platform-tools with at least one AVD for Android previews
- A JDK that your project's Gradle version supports
- Bun, for the install from source path
Steps
- Run
curl -fsSL https://raw.githubusercontent.com/hsandhu/mobilecode/main/install | bashto install MobileCode. - Open the React Native project folder as a session in MobileCode. Projects up to two directories below the session root are detected.
- Click Play on the iOS control in the session titlebar. The iOS simulator starts, the app builds, installs, and launches.
- Click Play on the Android control. The emulator starts and connects to the same Metro server that iOS already started.
- Use Stop on one platform to end only that run. Metro stays up while the other app is still running.
Prompt for your agent
Using the MobileCode repo at https://github.com/hsandhu/mobilecode, start the iOS and Android previews for the React Native project at <project-path> through its device-preview HTTP endpoints (POST /api/device-preview/run with platform ios, then android). Report the run status for each platform. Before reporting success, confirm with GET /api/device-preview that both platforms show a running state.
Caveat. iOS previews need macOS with Xcode, and the README does not describe support for other hosts.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for hsandhu/mobilecode and "Preview a React Native app on iOS and Android at once"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer