I have a M2 Mac, and I do not see "Open with Rosetta" option in the Finder -> Get Info.
When I run the command file $(which xcodebuild)
I'm able to see:
/usr/bin/xcodebuild: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/xcodebuild (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/xcodebuild (for architecture arm64e): Mach-O 64-bit executable arm64e
which indicates my Xcode is able to build both architectures.
I need to tell which architecture my Xcode should be able to build. When I open the Xcode by:
arch -arm64 /Applications/Xcode.app/Contents/MacOS/Xcode
I no longer see this error and can run on simulator without any issue.