-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added UDID to the simulator identifier in react-native run-ios
#5978
Conversation
By analyzing the blame information on this pull request, we identified @frantic to be a potential reviewer. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
@icodethings updated the pull request. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
react-native run-ios
react-native run-ios
@icodethings updated the pull request. |
I think it also happens to me, iPhone 6s is not starting, but 6 is. No error logged, so it definitely falls under the same empty catch. |
@icodethings updated the pull request. |
1 similar comment
@icodethings updated the pull request. |
I've updated it to just pass the UDID, without the rest of the simulator name and version. I'm pretty sure that's the best bet on reducing risk of any |
@@ -52,10 +52,10 @@ function _runIOS(argv, config, resolve, reject) { | |||
throw new Error(`Cound't find ${args.simulator} simulator`); | |||
} | |||
|
|||
const simulatorFullName = `${selectedSimulator.name} (${selectedSimulator.version})`; | |||
const simulatorFullName = `${selectedSimulator.name} (${selectedSimulator.version}) [${selectedSimulator.udid}]`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we then remove the udid from fullName then? I think that's more than we need to print on line 56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grabbou I was going to do that, but I was thinking about leaving it in there to make sure people can identify exactly what simulator is launched. Just incase you have, let's say, two iPhone 6 (iOS 9.2) setup.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but on the other hand - since we launch simulators based on the string (name), not its udid, I am not sure if it helps that much on regular basis. If you have say naming conflict, I am pretty sure the first device from the list will get selected.
Can |
Please rebase (This branch is out-of-date with the base branch). |
Added in the UDID to the `simulatorFullName` that is passed to `xcrun instruments -w`. If you have an simulator setup with an Apple Watch, just trying to launch a simulator like "iPhone 6 (9.2)" will cause a "Instruments Usage Error : Ambiguous device name/identifier" error because there is another simulator called "iPhone 6 (9.2) + Apple Watch"
Launching the simulator with just the UDID of the found simulator. This prevents any `Instruments Usage Error : Ambiguous device name/identifier` errors if someone has the same name on simulators with different iOS versions or an Apple Watch.
I can't find a scenario where UDID will be empty. If the I've tested this with a range of different simulator setups and I can't find a scenario that breaks it. |
I think I've figured out a more reliable way of doing this that can remove the need to rely on the regex parsing. I'll close of this PR and start another one soon. |
I've closed off this PR and created a new one with, what I think, is a much better way of solving this problem (and more). |
Added in the UUID to the
simulatorFullName
that is passed toxcrun instruments -w
.If you have an simulator setup with an Apple Watch, just trying to launch a simulator like
iPhone 6 (9.2)
will cause aInstruments Usage Error : Ambiguous device name/identifier
error because there could another simulator callediPhone 6 (9.2) + Apple Watch ...
Another alternative is to just pass the UUID to the
-w
flag.