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..c4c31d35a14667 100644 --- a/docsite/docs/getting-started.md +++ b/docsite/docs/getting-started.md @@ -37,14 +37,25 @@ 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). -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! 🎉