|
| 1 | +# The CLI |
| 2 | + |
| 3 | +React Native Brownfield comes with a batteries-included, all-in-one CLI tool called `brownie` that helps you build and publish your React Native app as a framework artifact for iOS (XCFramework) and Android (AAR). |
| 4 | +Additionally, it contains CLI utilities for other tools like the `@callstack/brownie` state management tool. |
| 5 | + |
| 6 | +## Publish for iOS |
| 7 | + |
| 8 | +Simply run `npx brownie package:ios` to create an XCFramework that you can later integrate into your native iOS app according to other instruction sections below. |
| 9 | + |
| 10 | +Available arguments: |
| 11 | + |
| 12 | +| Argument | Description | |
| 13 | +| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 14 | +| --verbose | Enable verbose logging | |
| 15 | +| --configuration | Explicitly set the scheme configuration to use. This option is case sensitive. | |
| 16 | +| --scheme | Explicitly set Xcode scheme to use | |
| 17 | +| --target | Explicitly set Xcode target to use | |
| 18 | +| --extra-params | Custom params that will be passed to xcodebuild command | |
| 19 | +| --export-extra-params | Custom params that will be passed to xcodebuild export archive command. Example: `--export-extra-params "-allowProvisioningUpdates"` | |
| 20 | +| --export-options-plist | Name of the export options file for archiving. Defaults to: `ExportOptions.plist` | |
| 21 | +| --build-folder | Location for iOS build artifacts. Corresponds to Xcode's "-derivedDataPath" | |
| 22 | +| --destination | Define destination(s) for the build. You can pass multiple destinations as separate values or repeated use of the flag. Values: "simulator", "device", or xcodebuild destinations | |
| 23 | +| --archive | Create an Xcode archive (IPA) of the build, required for uploading to App Store Connect or distributing to TestFlight | |
| 24 | +| --no-install-pods | Skip automatic CocoaPods installation | |
| 25 | +| --no-new-arch | Run React Native in legacy async architecture | |
| 26 | +| --local | Force local build with xcodebuild | |
| 27 | +| --verbose | Enable verbose logging | |
| 28 | + |
| 29 | +## Build for Android |
| 30 | + |
| 31 | +To build the artifact for Android without publishing, run `npx brownie package:android --module-name app`. |
| 32 | + |
| 33 | +Available arguments: |
| 34 | + |
| 35 | +| Argument | Description | |
| 36 | +| ------------- | ------------------------------------------------------------------------------------------------------------------------- | |
| 37 | +| --variant | Specify your app's build variant, which is constructed from build type and product flavor, e.g. 'debug' or 'freeRelease'. | |
| 38 | +| --module-name | AAR module name | |
| 39 | +| --verbose | Enable verbose logging | |
| 40 | + |
| 41 | +## Publish locally for Android |
| 42 | + |
| 43 | +To publish the `.aar`(s) built beforehand with `npx brownie package:android` to Maven local, which will allow Gradle to be able to load it from Maven local repository, run: |
| 44 | + |
| 45 | +`npx brownie publish:android --module-name app` |
| 46 | + |
| 47 | +| Argument | Description | |
| 48 | +| ------------- | ---------------------- | |
| 49 | +| --module-name | AAR module name | |
| 50 | +| --verbose | Enable verbose logging | |
0 commit comments