Summary:
This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.).
It's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box.
<s>This is still WIP and some of the commands are left commented out.</s>
For the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](e57683e420/local-cli/default.config.js (L33)), so they are available on the `new Config()` [instance](e57683e420/local-cli/cliEntry.js (L59)) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e
Closes https://github.com/facebook/react-native/pull/7899
Differential Revision: D3613193
Pulled By: bestander
fbshipit-source-id: 09a072f3b21e5239dfcd8da88a205bd28dc5d037
Summary:
When multiple simulator runtimes are available, this change will make it possible to specify which one to run. So assuming you have e.g. iOS 9.0 and 9.3 runtimes, all following calls will now work:
```
react-native run-ios --simulator "iPhone 6s (9.0)"
react-native run-ios --simulator "iPhone 6s (9.3)"
react-native run-ios --simulator "iPhone 6s"
```
Closes https://github.com/facebook/react-native/pull/8559
Differential Revision: D3516811
Pulled By: frantic
fbshipit-source-id: c81658f77e482e712293367b13d27e783e538aad
Summary:
The runIOS command currently assumes the path to the `xcodebuild` product - it's hardcoded
```
const appPath = `build/Build/Products/Debug-iphonesimulator/${inferredSchemeName}.app`;
```
https://github.com/facebook/react-native/blob/master/local-cli/runIOS/runIOS.js#L87
This can be a problem, when you e.g. install a release version of the app to the simulator using the cli. We use a separate schema for that, which can be selected with `--scheme`.
This fix reads the output of the `xcodebuild` call and searches for the path and the name of the *.app file. If it's found, then it will be used to spawn in the simulator. If not, the default (as before) is used.
Closes https://github.com/facebook/react-native/pull/8250
Differential Revision: D3469074
Pulled By: javache
fbshipit-source-id: b10c7e6f48268b0c71dfcbfa661f8e5960c3aaa6
Summary:In projects where you have multiple apps or a different structure (ios is not the directory containing the xcode project) it would be helpful to have the option to configure the directory containing the xcode project when doing "react-native run-ios"
As my PR does not change and does not affect UI it's hard to show a video ;-) Steps to reproduce are:
1. checkout facebook/react-native
2. run 'react-native run-ios' (it will fail)
3. npm link react-native (with my PR)
4. re-run 'react-native run-ios --ios-project-path Examples/Movies/
Now the simulator should open the Movies example app
Closes https://github.com/facebook/react-native/pull/6134
Differential Revision: D3035188
fb-gh-sync-id: edb924ce3cca4e82161cdce3d25f321b03abc765
fbshipit-source-id: edb924ce3cca4e82161cdce3d25f321b03abc765
Summary:When running `react-native run-ios`, this feature allows a user to specify which scheme to run.
My project's scheme name is not the same as the xcode project name. Running `react-native run-ios` would error with the following:
```
± |master ↓95 ✓| → react-native run-ios
Found Xcode workspace Poot.xcworkspace
Launching iPhone 6 (9.2)...
Building using "xcodebuild -workspace Poot.xcworkspace -scheme Poot -destination id=2B3E8AAC-DD61-414C-95BD-F4829A8F7CE6 -derivedDataPath build"
User defaults from command line:
IDEDerivedDataPathOverride = /Users/mrickert/Documents/project/ios/build
xcodebuild: error: The workspace named "Poot" does not contain a scheme named "Poot". The "-list" option can be used to find the names of the schemes in the workspace.
Installing build/Build/Products/Debug-iphonesimulator/Poot.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was n
Closes https://github.com/facebook/react-native/pull/6157
Differential Revision: D3020313
Pulled By: frantic
fb-gh-sync-id: 9d99fa382b3f50045759acea18eff418b15d511d
shipit-source-id: 9d99fa382b3f50045759acea18eff418b15d511d
Summary:
Works the same way as `react-native run-android`, but targets iOS simulator instead. Under the hood, it uses `xcodebuild` to compile the app and store it in `ios/build` folder, then triggers `instruments` and `simctl` to install and launch the app on simulator.
Since Facebook relies on BUCK to build and run iOS app, we probably won't use `run-ios` internally. That's why I'm putting this as public PR instead of internal diff.
To test this, I hacked global `react-native` script to install react native from my local checkout instead of from npm, cd into the folder and ran `react-native run-ios`.
Closes https://github.com/facebook/react-native/pull/5119
Reviewed By: svcscm
Differential Revision: D2805199
Pulled By: frantic
fb-gh-sync-id: 423a45ba885cb5e48a16ac22095d757d8cca7e37