Build and run a NitroUI app without a Mac
You can build a NitroUI 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 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 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:
- Installs the Node packages with the package manager the project uses. The starter's
bun.lockselects Bun, and Bun runs thepostinstallprepare. - Runs
bun x --no-install nitro-ui prepareagain, on every build, so.nitro/matches the currentapp.jsonand modules even when the install was skipped. - Runs
xcodebuildor 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:
bunx create-nitro-ui@latest MyApp
cd MyApp
Install the Limrun CLI and give it an API key from the console:
npm install --global lim
export LIM_API_KEY=lim_...
Build for iOS and install the app on a cloud simulator:
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:
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:
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:
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:
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:
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.jsonof 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.locknext topackage-lock.json, the sandbox skips the install and the build fails the same way. Keep one lockfile, or setpackageManagerinpackage.json. - NitroUI needs Xcode 27.
lim xcode versionshows the Xcode a sandbox uses, and--xcode-versiononlim xcode buildorlim xcode version setpicks another. See Xcode and tool versions.
The full setup, including the Android dev-server commands and Release builds for Android, is in Build NitroUI apps without a Mac. Apps on React Native without NitroUI follow the React Native guide, and Expo apps follow the Expo guide.