Atef
Atef

Reputation: 2902

Run xcode project in rosetta mode from terminal?

I have M1 machine, I have one project that I only need Rosetta to run it, instead of toggle it on/off from Xcode get info menu enter image description here

I tried to run the command: arch -x86_64 open ~<PROJECTNAME>.xcodeproj

but the project failed to build each time.

Can someone help me with a command to build the project from command line in Rosetta mode,

Upvotes: 2

Views: 7557

Answers (2)

Soumya Mahunt
Soumya Mahunt

Reputation: 2762

Instead of maintaining two copies Xcode, you can use the following command to run your default Xcode installation under rosetta:

arch -x86_64 /Applications/Xcode.app/Contents/MacOS/Xcode

XCode update

With XCode 14.3 you can choose the destination architecture to be shown, you can select "Show both" to show both M1 and rosetta version of the simulator destination from the default XCode installation:

Destination arch selection menu Destination selection menu

Upvotes: 6

matt
matt

Reputation: 534882

Keep two copies of Xcode and keep one of them in Rosetta mode. You might even name it Xcode-Rosetta so you know which is which.

That way there's no need to turn Rosetta on and off for the same app.

Upvotes: 4

Related Questions