---
title: Build and run a NitroUI app without a Mac
description: NitroUI's iOS builds need Xcode 27 on a Mac. Build a NitroUI app on
  Limrun's cloud Xcode and Gradle sandboxes from Linux, Windows, or a coding
  agent, and run it on a cloud simulator.
author: Limrun
date: 2026-12-03
url: https://limrun.com/blog/nitro-ui-without-a-mac/
---

# Build and run a NitroUI app without a Mac

You can build a [NitroUI](https://nitro-ui.com) app for iOS and Android from a Linux machine, a Windows laptop, or a coding agent's container, and run it on a cloud simulator. Limrun runs the Xcode and Gradle builds on cloud sandboxes, and the `lim` CLI drives them from wherever your code is.

NitroUI is Margelo's framework for native iOS and Android apps written in React and TypeScript. Its [installation guide](https://nitro-ui.com/docs/installation) lists the host requirements: iOS builds use Xcode 27 on an Apple Silicon Mac, and Linux and Windows hosts can target Android only. This post shows how to build both platforms without that Mac, and what the build sandbox does so the app compiles.

## Why a plain native build fails

A NitroUI app keeps permanent native projects in `ios/` and `android/`, which you commit. Those projects build against a directory you do not commit: `.nitro/`.

The starter's `package.json` runs `nitro-ui prepare` as its `postinstall` script. Prepare reads the installed packages, `app.json`, and your local modules, then writes `.nitro/`: build settings, Swift package wrappers, registration glue, and links into `node_modules/`. The [NitroUI CLI README](https://www.npmjs.com/package/nitro-ui-cli) calls these files disposable and says to keep them out of version control, and the starter's `.gitignore` lists both `.nitro/` and `node_modules/`.

The Xcode project references the app's generated Swift package at `.nitro/app`. On a fresh clone, or on any machine that receives only the committed files, that directory does not exist. Run `xcodebuild` there without installing first, and the build stops almost immediately with `the package at .nitro/app cannot be accessed`.

So a NitroUI build needs three steps, in order: install the Node packages, run `nitro-ui prepare`, then run Xcode or Gradle.

## How Limrun handles it

`lim xcode build` syncs your project folder to an Xcode sandbox and runs `xcodebuild` there. `lim gradle build` does the same with a Gradle sandbox. The sync skips the paths your `.gitignore` excludes, so `.nitro/` and `node_modules/` stay on your machine. On a new starter app, our sync sent 144 KB.

The sandbox recreates them on its side. Before the native build, it checks the root `package.json`. When `nitro-ui-cli` is a dependency, the sandbox:

1. Installs the Node packages with the package manager the project uses. The starter's `bun.lock` selects Bun, and Bun runs the `postinstall` prepare.
2. Runs `bun x --no-install nitro-ui prepare` again, on every build, so `.nitro/` matches the current `app.json` and modules even when the install was skipped.
3. Runs `xcodebuild` or Gradle against the prepared project.

Later builds skip the install while `package.json` and the lockfile are unchanged, but they still run prepare. On a second build, the log goes straight to `$ bun x --no-install nitro-ui prepare` and then to Xcode.

## Build and run it

Create the app with NitroUI's starter. This step needs only Bun, which runs on Linux and Windows:

```sh
bunx create-nitro-ui@latest MyApp
cd MyApp
```

Install the Limrun CLI and give it an API key from the [console](https://console.limrun.com/api-keys):

```sh
npm install --global lim
export LIM_API_KEY=lim_...
```

Build for iOS and install the app on a cloud simulator:

```sh
lim xcode build . --ios
```

`--ios` reuses a recent Xcode sandbox with an attached simulator, or creates and attaches both, and installs every successful build on the simulator. The sandbox finds `ios/NitroUI.xcodeproj` and its `NitroUI` scheme without flags. In our run on a fresh sandbox, the Debug build took 1 minute 25 seconds and the install took 2 seconds. The log shows the order: `bun install`, the prepare step, then `xcodebuild` with Xcode 27.1.

Build for Android on a Gradle sandbox, then attach an emulator so each build installs on it:

```sh
lim gradle build .
lim android create --no-connect
lim gradle attach-emulator
```

## See the app and edit it live

A Debug build loads its JavaScript from NitroUI's dev server. On a cloud simulator, the first launch shows a **Dev Servers** screen with no servers found, because the simulator is not on your network.

Start the dev server on your machine. It listens on `localhost:8081`:

```sh
bun run start
```

In a second terminal, open a tunnel from the simulator's `localhost:8081` to your machine, then relaunch the app with the server address as a launch argument. The starter's bundle identifier is `com.example.` plus the app name in lowercase:

```sh
lim ios tunnel --selector localhost:8081 --detach
lim ios simctl -- launch --terminate-running-process booted com.example.myapp \
  -NitroUIDevServerURL http://localhost:8081
```

The app opens the starter screen. When we edited the text in `src/App.tsx` and saved, the simulator showed the new text within five seconds, with no rebuild. The app remembers the server, so later builds reconnect to it on their own.

To run the app without a dev server, build Release. NitroUI compiles the Release JavaScript to native code with Static Hermes, so the bundle is inside the app:

```sh
lim xcode build . --ios --configuration Release
```

## From a Linux coding agent

The commands above need no macOS tools, so a coding agent in a Linux container runs them unchanged. Set `LIM_API_KEY` in the agent's environment, install `lim` with npm, and let it run `lim xcode build . --ios` after each change. The build log streams back, so the agent reads Swift and TypeScript errors in its own terminal.

To check the result, the agent can take a screenshot of the simulator and look at it:

```sh
lim ios screenshot screen.png
```

A Release build suits an agent that only needs to see the app, because it skips the dev server and tunnel. For edit-and-look loops, an agent that already runs `bun run start` in its container can open the same tunnel.

## Current limits

- The sandbox reads only the root `package.json` of the synced folder. A NitroUI app nested inside a larger monorepo is not detected yet, and its build fails on the missing `.nitro/` directory.
- When the package manager is ambiguous, for example with `bun.lock` next to `package-lock.json`, the sandbox skips the install and the build fails the same way. Keep one lockfile, or set `packageManager` in `package.json`.
- NitroUI needs Xcode 27. `lim xcode version` shows the Xcode a sandbox uses, and `--xcode-version` on `lim xcode build` or `lim xcode version set` picks another. See [Xcode and tool versions](https://docs.limrun.com/ios/xcode-and-tools).

The full setup, including the Android dev-server commands and Release builds for Android, is in [Build NitroUI apps without a Mac](https://docs.limrun.com/frameworks/nitro-ui). Apps on React Native without NitroUI follow [the React Native guide](https://docs.limrun.com/frameworks/react-native), and Expo apps follow [the Expo guide](https://docs.limrun.com/frameworks/expo).
