Skip to content
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

How to set arch for xcodebuild destination? #5419

Closed
mo5tone opened this issue Sep 15, 2023 · 5 comments · Fixed by #5527
Closed

How to set arch for xcodebuild destination? #5419

mo5tone opened this issue Sep 15, 2023 · 5 comments · Fixed by #5527
Labels
type:need/problem Report needs or problems you came across that are not bugs

Comments

@mo5tone
Copy link
Contributor

mo5tone commented Sep 15, 2023

What problem or need do you have?

As the Xcode 14.3 has dropped the Rosetta support for Xcode (Release Notes).
So the arch -x86_64 (#5298) prefix won't work anymore with Xcode 14.3 and later.

The xcodebuild provides an option to select the rosetta simulators for building and testing.
xcodebuild -workspace App.xcworkspace -scheme App -destination "platform=iOS Simulator,name=iPhone 14,arch=x86_64" test

But when I ran tuist test -d 'iPhone 14 (Rosetta),arch=x86_64' or tuist test -d 'iPhone 14 (Rosetta)', it just failed with below error:

Could not find a suitable device for iOS, device name iPhone 14 (Rosetta). Did find iPhone SE (3rd generation) (iOS 16.4), iPhone 14 (iOS 16.4), iPhone 14 Plus (iOS 16.4), iPhone 14 Pro (iOS 16.4), iPhone 14 Pro Max (iOS 16.4), iPad Air (5th generation) (iOS 16.4), iPad (10th generation) (iOS 16.4), iPad mini (6th generation) (iOS 16.4), iPad Pro (11-inch) (4th generation) (iOS 16.4), iPad Pro (12.9-inch) (6th generation) (iOS 16.4)
Consider creating an issue using the following link: https://github.com/tuist/tuist/issues/new/choose

Potential solution

No response

macOS version

13.0.1 (22A400)

Tuist version

3.26.0

Xcode version

14.3.1 (14E300c)

@mo5tone mo5tone added the type:need/problem Report needs or problems you came across that are not bugs label Sep 15, 2023
@apps4everyone
Copy link
Sponsor Contributor

This can only be done by hacking and changing the binary and extend the XCFramework

Read this two articles by the arm64-to-sim creator @bogo
https://bogo.wtf/arm64-to-sim.html
https://bogo.wtf/arm64-to-sim-dylibs.html

@apps4everyone
Copy link
Sponsor Contributor

is the XCFramework publicity available?

@mo5tone
Copy link
Contributor Author

mo5tone commented Sep 16, 2023

This can only be done by hacking and changing the binary and extend the XCFramework

Read this two articles by the arm64-to-sim creator @bogo https://bogo.wtf/arm64-to-sim.html https://bogo.wtf/arm64-to-sim-dylibs.html

Nice articles, thanks for sharing.

But hacking binaries cannot meet our security compliance check.

And I found that fastlane has add a parameter to scan for this issue in [#21284], so I think tuist might provide a similar solution for tuist build\test.

Below is the xcodebuild command used by fastlane scan when use rosetta simulators:

set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug -scmProvider system -disableAutomaticPackageResolution -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,id=D4668B60-A18D-413F-BEF8-E70253724603,arch=x86_64' -enableCodeCoverage NO -testPlan 'UnitTests' -skipPackagePluginValidation -retry-tests-on-failure -test-iterations 10 clean test

This line do the trick:

-destination 'platform=iOS Simulator,id=D4668B60-A18D-413F-BEF8-E70253724603,arch=x86_64'

@danieleformichelli
Copy link
Collaborator

Thanks @mo5tone ! I think it makes sense, would you like to try to add support for this in Tuist?

@mo5tone
Copy link
Contributor Author

mo5tone commented Oct 15, 2023

Thanks @mo5tone ! I think it makes sense, would you like to try to add support for this in Tuist?

Sure, I'd like to help address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:need/problem Report needs or problems you came across that are not bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants