Fixes bundling/running on fooOSSimulator #127
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes: #126
Its a pretty simple fix and no relevant sideeffects are immediately coming to my mind.
If xcodebuild is used and arguments.simulatorSpecifier is set inside
BundleCommand/doBundlingI first append additionalArguments by“simulatorSpecifier”to letXcodeBuild/buildknow it is set. the specifier gets appended immediately after.XcodeBuild/buildchecks if the target platform is a simulator. If it is, it looks for the first index of”simulatorSpecifier”and makes sure there are more arguments than index + 1, to avoid accessing the array out of bounds.If it was able to retrieve the specifier, it checks if its a UUID or name, because sbun allows either as value for
--simulatorIf its a uuid, the destinationString sets id after the platform, if it isn’t it gets set as name.
“simulatorSpecifier”and the specifier get removed from additionalArguments to not interfere with the xcodebuild command later.A possible alternative to doing it this way would be a dictionary parameter on
Xcodebuild/buildto pass it there instead.As
Xcodebuild/buildcurrently only gets used in one place I don’t think one solution is inherently better than the other and I can easily switch them out in case you prefer the other method.