DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to preview a React Native app on iOS and Android at once with Mobilecode

Run one React Native project on both simulators from a single MobileCode session.

Short answer: Run curl -fsSL https://raw.githubusercontent.com/hsandhu/mobilecode/main/install | bash to install MobileCode; then 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. All steps.

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

  1. Run curl -fsSL https://raw.githubusercontent.com/hsandhu/mobilecode/main/install | bash to install MobileCode.
  2. Open the React Native project folder as a session in MobileCode. Projects up to two directories below the session root are detected.
  3. Click Play on the iOS control in the session titlebar. The iOS simulator starts, the app builds, installs, and launches.
  4. Click Play on the Android control. The emulator starts and connects to the same Metro server that iOS already started.
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer