https://github.com/breezertwo/react-native-simboot
This script will speed up deploying your ReactNative app to a simulator or a device. It searches for any available simulator or device, without having to look for UDID or device names by yourself. The script will also pick up any configured build configurations for your project and let's you choose what you want to build.
https://github.com/breezertwo/react-native-simboot
android cli ios react-native simulator
Last synced: 4 months ago
JSON representation
This script will speed up deploying your ReactNative app to a simulator or a device. It searches for any available simulator or device, without having to look for UDID or device names by yourself. The script will also pick up any configured build configurations for your project and let's you choose what you want to build.
- Host: GitHub
- URL: https://github.com/breezertwo/react-native-simboot
- Owner: breezertwo
- License: mit
- Created: 2022-10-29T10:07:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-14T07:37:14.000Z (about 3 years ago)
- Last Synced: 2025-08-08T05:39:09.178Z (11 months ago)
- Topics: android, cli, ios, react-native, simulator
- Language: TypeScript
- Homepage:
- Size: 1.4 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-native-simboot
Tired from searching an UUID or deviceID after adding a new simulator? A colleague wants to see the prototype on his own phone just "real quick"? Confused about the different build configurations in your project?
This script will speed up deploying your ReactNative app to a simulator or a device for testing.
It automatically searches for any available simulator or device. (iOS only at the moment)
The script will pick up any available build configuration from Xcode (iOS) or the productFlavor and buildType variants from build.gradle (Android) and let you choose which one you want to run your app with.
After the prompt, the script will run the `react-native run-` command and start the app on the selected device.
## Install
yarn:
```
yarn add -D react-native-simboot
```
npm:
```
npm i -D react-native-simboot
```
## Use
Simply run in the root folder of your RN project:
```
npx react-native simboot --ios # run ios build
npx react-native simboot --android # run android build
```
### Prerequisites
If you are developing react-native apps on your machine, you should have the following tools already installed:
- iOS: [XCode Command Line Tools](https://developer.apple.com/library/archive/technotes/tn2339/_index.html) (xcodebuild, xcrun)
- Android: [Android Debug Bridge](https://developer.android.com/studio/command-line/adb) (adb)
### Additional flags
#### Specify project path
Usually the project files are located in the ios and android folders. If you have a different structure, you can specify the path to the Xcode project and the Gradle project with these flags.
If you have set the locations in `react-native.config.js`, they should be automatically detected.
```
--ios-xcodeproj-path [string] # specify custom xcode project path
--android-gradle-path [string] # specify custom build.gradle path
```
#### Flags set by script for run-android and run-ios and how they are used
|
Flag | Info | OS |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| --uuid | From user selection | iOS |
| --configuration | From user selection | iOS |
| --variant | Composed from productFlavor & buildType selection | android |
| --appId | Taken from defaultConfig in build.gradle. Overwritten if value set in choosen productFlavor | android |
| --deviceId | From user selection ⚠️ only supported with RN 0.72.0-rc.0 or react-native-cli 11.0.0 or higher (see [Issue](https://github.com/react-native-community/cli/issues/1754)). Device selection for android not availabe if lower cli version detected | android |
## Config file
You can configure the script by adding a `simboot.config.js` file to the root of your project.
| Value |
Type | Explanation |
| ----------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| verbose | boolean | get detailed output |
| dryRun | boolean | don't run any build after selection |
| customScriptPhase | (config: SelectedConfig) => void | run custom script after selection but before react-native build (e.g to set env). `config` contains the selected configuration |
Depending on the operating system selected, the `customScriptPhase` function will be called with `config` containing the following values:
```ts
interface SelectedConfig {
ios: {
configuration?: string
device?: {
name: string
udid: string
}
}
}
```
```ts
interface SelectedConfig {
android: {
buildType?: string
productFlavor?: string
}
}
```
## Example (iOS)
```
🏃 Running react-native-simboot
🍏 Running iOS script
👀 Collecting build information
✔ Pick configuration:
❯ Debug
Release
Stage
✔ Pick a device:
iPad Pro (12.9-inch) (6th generation) - iOS 16.2
iPad Pro (9.7-inch) - iOS 15.0
iPad mini (6th generation) - iOS 15.0
iPad mini (6th generation) - iOS 16.2
❯ iPhone 13 - iOS 15.0
iPhone 13 Pro - iOS 15.0
iPhone 13 Pro Max - iOS 15.0
iPhone 13 mini - iOS 15.0
↓ iPhone 14 - iOS 16.2
🚀 ReactNative build finished successfully
```
#### Roadmap
- add config option for
- preselect device types
- preselect iOS versions