sweetpad-dev / sweetpad

Develop Swift/iOS projects using VSCode
https://marketplace.visualstudio.com/items?itemName=sweetpad.sweetpad
MIT License
115 stars 3 forks source link

Rosetta label for simulators #16

Open jfd02 opened 2 weeks ago

jfd02 commented 2 weeks ago

Our project requires compilation using rosetta simulators, right now I don't believe this label is being displayed in the simulator list

hyzyla commented 2 weeks ago

Hello! I've never worked with Rosetta simulators. Could you tell me how I can create a project like that in Xcode?

jfd02 commented 2 weeks ago

In Xcode you can go to Product > Destination > Destination Architectures > Show both

hyzyla commented 2 weeks ago

Thank you so much! I'll check later after vacation

hyzyla commented 1 week ago

Hello! As I understand how simulators work, we don't need to run the simulator in Rosetta mode. We just need to build the application for the x86_64 architecture, and then, when you run the application on the simulator, macOS can automatically determine that the application should be run in Rosetta mode. I've found that to build the application for the x86_64 architecture, you can set ARCHS=x86_64 VALID_ARCHS=x86_64 ONLY_ACTIVE_ARCH=NO in your xcodebuild command (or in Xcode configurations). Here is the PR [1] that adds support for the "sweetpad.build.arch": "x86_64" configuration for building application for x86_64 architecture.

Let me know if this is the right direction to resolve your issue.

  1. https://github.com/sweetpad-dev/sweetpad/pull/18/files#diff-7d7056ba834da895f939e1ed1aa66cb323d19207384c944d47cf2d73d7a4772cR131