{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "hsandhu-mobilecode--preview-react-native-app-on-ios-and-android",
 "repo": "hsandhu/mobilecode",
 "repo_url": "https://github.com/hsandhu/mobilecode",
 "repo_slug": "hsandhu-mobilecode",
 "title": "Preview a React Native app on iOS and Android at once",
 "page_title": "How to preview a React Native app on iOS and Android at once with Mobilecode",
 "summary": "Run one React Native project on both simulators from a single MobileCode session.",
 "who": "A 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.",
 "problem": "Setting up Metro, simulators, emulators, and native builds for two platforms by hand is slow and easy to get wrong.",
 "outcome": "Both platforms run the same project in the device pane, with one shared Metro server.",
 "steps": [
  "Run `curl -fsSL https://raw.githubusercontent.com/hsandhu/mobilecode/main/install | bash` to 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."
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "iOS previews need macOS with Xcode, and the README does not describe support for other hosts.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "remote-script",
   "notice": "The install command pipes a script from GitHub straight into bash, so read it first or pin a known release before running it."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/hsandhu-mobilecode/preview-react-native-app-on-ios-and-android/",
 "md": "https://dedupedai.com/use-cases/hsandhu-mobilecode/preview-react-native-app-on-ios-and-android/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/hsandhu-mobilecode--preview-react-native-app-on-ios-and-android.json",
 "api_version": "v1"
}
