Skip to content

Fixes bundling/running on fooOSSimulator#127

Closed
MiaKoring wants to merge 2 commits intomoreSwift:mainfrom
MiaKoring:fix-build-for-simulators
Closed

Fixes bundling/running on fooOSSimulator#127
MiaKoring wants to merge 2 commits intomoreSwift:mainfrom
MiaKoring:fix-build-for-simulators

Conversation

@MiaKoring
Copy link
Contributor

@MiaKoring MiaKoring commented Jan 9, 2026

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/doBundling I first append additionalArguments by “simulatorSpecifier” to let XcodeBuild/build know it is set. the specifier gets appended immediately after.

XcodeBuild/build checks 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 --simulator

If 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/build to pass it there instead.

As Xcodebuild/build currently 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.

MiaKoring and others added 2 commits January 9, 2026 19:13
Bundle command forwards simulatorSpecifier to the xcodebuild command generation, where its used to specify the target instead of generic/platform
@bbrk24
Copy link
Contributor

bbrk24 commented Feb 4, 2026

Partial matches don't seem to work anymore (e.g. I have to say --simulator 'iPhone 17', not --simulator iPhone).

@stackotter
Copy link
Collaborator

Replaced by #142 which fixes architecture handling within our xcodebuild wrapper as a whole (as best as we can within the constraints of xcodebuild)

@stackotter stackotter closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trying to build for iOSSim fails

3 participants