From 1841ed8fb5f1c447af1f40387a8c7758c78478a8 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Sat, 8 Nov 2025 18:37:34 -0800 Subject: [PATCH 1/3] chore(docs): document our CLI commands --- docsite/docs/cli-commands.md | 51 +++++++++++++++++++++++++++++++++ docsite/docs/getting-started.md | 35 ++++++++++++++++------ 2 files changed, 78 insertions(+), 8 deletions(-) create mode 100644 docsite/docs/cli-commands.md diff --git a/docsite/docs/cli-commands.md b/docsite/docs/cli-commands.md new file mode 100644 index 00000000000000..d20af05cab3105 --- /dev/null +++ b/docsite/docs/cli-commands.md @@ -0,0 +1,51 @@ +--- +sidebar_position: 3 +title: CLI Commands +--- + +# CLI Commands + +React Native for macOS provides several command-line tools to help you develop, build, and run your macOS applications. + +## Overview + +The React Native CLI for macOS extends the standard React Native CLI with macOS-specific commands. These commands help you build and run your React Native applications on macOS. + +## Available Commands + +### `run-macos` + +Builds your React Native macOS app and launches it on your local machine. + +```bash +npx react-native run-macos [options] +``` + +#### Options + +| Option | Description | Default | +|--------|-------------|---------| +| `--mode [string]` | Set the build configuration (Debug, Release) | Debug | +| `--scheme [string]` | Explicitly set the Xcode scheme to use | `{ProjectName}-macOS` | +| `--project-path [string]` | Path relative to project root where the Xcode project lives | `macos` | +| `--no-packager` | Do not launch Metro bundler while building | `false` | +| `--port [number]` | Port for the Metro bundler | `8081` | +| `--terminal [string]` | Terminal to use for launching Metro bundler | System default | +| `--verbose` | Show detailed build output (disable xcpretty) | `false` | + +### `build-macos` + +Builds your React Native macOS app without launching it. + +```bash +npx react-native build-macos [options] +``` + +#### Options + +| Option | Description | Default | +|--------|-------------|---------| +| `--mode [string]` | Set the build configuration (Debug, Release) | Debug | +| `--scheme [string]` | Explicitly set the Xcode scheme to use | `{ProjectName}-macOS` | +| `--project-path [string]` | Path relative to project root where the Xcode project lives | `macos` | +| `--verbose` | Show detailed build output (disable xcpretty) | `false` | diff --git a/docsite/docs/getting-started.md b/docsite/docs/getting-started.md index 66126c718c4225..15e23b372ddea4 100644 --- a/docsite/docs/getting-started.md +++ b/docsite/docs/getting-started.md @@ -37,14 +37,33 @@ npx react-native-macos-init ## Running a React Native macOS App -- **Without using Xcode**: - In your React Native macOS project directory, run: +### Quick Start - ``` - npx react-native run-macos - ``` +In your React Native macOS project directory, run: -- **Using Xcode**: - Open `macos\test.xcworkspace` in Xcode or run `xed -b macos`; `yarn start`. Hit the Run button. +```bash +npx react-native run-macos +``` + +This will build your app and launch it automatically. A Metro bundler window will also open to serve your JavaScript code. + +### Alternative Methods + +- **Using Xcode**: Open `macos/{YourProject}.xcworkspace` in Xcode or run `xed -b macos`, then hit the Run button. +- **Build only**: Use `npx react-native build-macos` to build without launching. + +:::tip +The first run may take a while since it involves building the entire project and all dependencies. Subsequent runs will be much faster! +::: + +For more detailed information about CLI commands and build options, see the [CLI Commands](./cli-commands.md) and [Building and Running](./guides/building-and-running.md) guides. + +## Next Steps + +Now that you have your React Native macOS app running, you can: + +- Explore the [guides](./guides/) for advanced development topics +- Learn about [native development](./guides/native-development.md) for macOS-specific features +- Check out the [API documentation](../api/intro.md) for available components and APIs -A new Command Prompt window will open with the React packager as well as a `react-native-macos` app. This step may take a while during first run since it involves building the entire project and all dependencies. You can now start developing! 🎉 +Happy coding! 🎉 From 304128afa1b3222aebc31c63fd0696ef7218df30 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Sun, 9 Nov 2025 13:24:17 -0800 Subject: [PATCH 2/3] Update getting-started.md --- docsite/docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsite/docs/getting-started.md b/docsite/docs/getting-started.md index 15e23b372ddea4..da574f4951341f 100644 --- a/docsite/docs/getting-started.md +++ b/docsite/docs/getting-started.md @@ -56,7 +56,7 @@ This will build your app and launch it automatically. A Metro bundler window wil The first run may take a while since it involves building the entire project and all dependencies. Subsequent runs will be much faster! ::: -For more detailed information about CLI commands and build options, see the [CLI Commands](./cli-commands.md) and [Building and Running](./guides/building-and-running.md) guides. +For more detailed information about CLI commands and build options, see the [CLI Commands](./cli-commands.md). ## Next Steps From 74f8f1ca93c019c18d7d2afacf08773eb670785e Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Sun, 9 Nov 2025 16:56:48 -0800 Subject: [PATCH 3/3] fix --- docsite/docs/getting-started.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docsite/docs/getting-started.md b/docsite/docs/getting-started.md index da574f4951341f..c4c31d35a14667 100644 --- a/docsite/docs/getting-started.md +++ b/docsite/docs/getting-started.md @@ -58,12 +58,4 @@ The first run may take a while since it involves building the entire project and For more detailed information about CLI commands and build options, see the [CLI Commands](./cli-commands.md). -## Next Steps - -Now that you have your React Native macOS app running, you can: - -- Explore the [guides](./guides/) for advanced development topics -- Learn about [native development](./guides/native-development.md) for macOS-specific features -- Check out the [API documentation](../api/intro.md) for available components and APIs - Happy coding! 🎉