Pass port when running on device (fix #17973)

Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Building for iOS device `react-native run-ios --device [id]` fails since port is not passed. This is a blocker for us and prevents us from updating to latest React Native stable.

I've tested this in our app and also in fresh app using RN master and verified that it works.

None.

[CLI] [BUGFIX] [local-cli/runIOS/runIOS.js] - Pass metro port when running on device
<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/17983

Differential Revision: D6988299

Pulled By: hramos

fbshipit-source-id: 5169706600f87f13b9c9c105eb7d6db7a40194f1
This commit is contained in:
Johan Ruokangas 2018-02-14 08:02:13 -08:00 committed by Facebook Github Bot
parent 10b642a7af
commit f8fee0a631
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ function runIOS(argv, config, args) {
if (args.device) { if (args.device) {
const selectedDevice = matchingDevice(devices, args.device); const selectedDevice = matchingDevice(devices, args.device);
if (selectedDevice) { if (selectedDevice) {
return runOnDevice(selectedDevice, scheme, xcodeProject, args.configuration, args.packager, args.verbose); return runOnDevice(selectedDevice, scheme, xcodeProject, args.configuration, args.packager, args.verbose, args.port);
} else { } else {
if (devices && devices.length > 0) { if (devices && devices.length > 0) {
console.log('Could not find device with the name: "' + args.device + '".'); console.log('Could not find device with the name: "' + args.device + '".');