react-native/local-cli
Stephen Poter 8b55e50d1d Fix error in react-native run-ios when Product Name and Scheme are inequal
Summary:
In xcode, you can modify the Product Name per build configuration.  During the build, the app file name is made using that value.  For example, I name my app "MyApp Dev", it will build into "MyApp Dev.app".

react-native run-ios doesn't extract the proper app name.  Instead it uses the scheme name + ".app".  So if in the example above I use the default Scheme "MyApp", which references the build configuration whose name is "MyApp Dev".  The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.

My fix parses the build output and extracts the app name from the line "export FULL_PRODUCT_NAME=$(appfilename)" and uses that instead of the scheme.  If there is any issue parsing, the scheme name is used like it currently is.

**Test plan (required)**

1) Change the Product Name in xcode project manager to be something different than the scheme name.
2) Run react-native run-ios and ensure it works.
Closes https://github.com/facebook/react-native/pull/10178

Differential Revision: D4022116

Pulled By: javache

fbshipit-source-id: c1bd8e7a1f6364d681c505557a96955a293bc05c
2016-10-14 14:43:52 -07:00
..
__mocks__ added new property to mock in chalk.js 2016-09-29 04:13:33 -07:00
__tests__ Temporarily disable cli tests 2015-11-12 07:05:01 -08:00
android CLI errors if no package.json is found 2016-10-14 10:58:43 -07:00
bundle Remove platform blacklists 2016-09-23 08:13:46 -07:00
core Update getCommands.js 2016-09-14 13:43:47 -07:00
dependencies Remove platform blacklists 2016-09-23 08:13:46 -07:00
generate Revert "Add folders to attempt to unblock sync" 2015-10-26 22:48:10 +00:00
generator Adding jest and jest babel preset to the react-native init command 2016-09-09 17:43:42 -07:00
generator-android Android package name validator consistent with docs 2016-09-09 04:13:49 -07:00
generator-ios replace old ATS key name to new one. 2016-10-09 12:13:37 -07:00
init Merge `rnpm cli` into react-native 2016-07-30 09:13:46 -07:00
install Further RNPM integration 2016-08-22 08:58:37 -07:00
library Merge `rnpm cli` into react-native 2016-07-30 09:13:46 -07:00
link Removing automatically reset modules between test run 2016-09-19 12:43:55 -07:00
logAndroid Merge `rnpm cli` into react-native 2016-07-30 09:13:46 -07:00
logIOS Merge `rnpm cli` into react-native 2016-07-30 09:13:46 -07:00
runAndroid Add `checkAndroid` back 2016-08-17 17:43:53 -07:00
runIOS Fix error in react-native run-ios when Product Name and Scheme are inequal 2016-10-14 14:43:52 -07:00
server remove dependency between aggrow and stackRegistry 2016-10-06 07:58:36 -07:00
upgrade Merge `rnpm cli` into react-native 2016-07-30 09:13:46 -07:00
util Add `--config` option to CLI to allow passing a path to an `rn-cli.config.js` 2016-08-12 11:58:33 -07:00
.eslintrc Disable `extra-arrow-initializer` rule in node directories 2016-09-27 13:43:37 -07:00
cli.js Monkey-patch `fs` with graceful-fs before anything else runs 2016-10-14 11:13:54 -07:00
cliEntry.js Monkey-patch `fs` with graceful-fs before anything else runs 2016-10-14 11:13:54 -07:00
commands.js Attach origin of a 3rd party command 2016-08-29 08:43:49 -07:00
default.config.js Remove platform blacklists 2016-09-23 08:13:46 -07:00
generate-android.js Add license headers to local-cli 2015-10-20 09:55:21 -07:00
generator-utils.js Android package name validator consistent with docs 2016-09-09 04:13:49 -07:00
setup_env.bat Fix comments on .bat file 2015-10-28 21:36:07 -04:00
setup_env.sh Change ulimit to 2048 for non root Mac users 2016-02-06 11:45:37 -08:00
wrong-react-native.js Fix usage of react-native cli inside package.json scripts 2016-04-26 15:42:35 -07:00