Qazi Ammar
Qazi Ammar

Reputation: 1526

debugserver is x86_64 binary running in translation, attached failed. Could not attach to pid :

I just shifted my Xcode project from my Intel Mac to Apple M1 Chip. The code is compiled successfully on M1 Chip but once I tried to run it on simulator it shows the following error.

debugserver is x86_64 binary running in translation, attached failed.

Xcode simulator Error

I have checked the "Open using Rosettea" option for Xcode but it still not running M1 machine.

Upvotes: 18

Views: 17880

Answers (10)

Rups
Rups

Reputation: 41

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.

Upvotes: 1

markshiz
markshiz

Reputation: 2561

If you have multiple versions of Xcode installed (including Xcode 14.3) you may need to perform the following song and dance:

https://stackoverflow.com/a/72946533/731285

Upvotes: 0

Bhishak Sanyal
Bhishak Sanyal

Reputation: 129

Assuming its not solved yet, can you try the following and let us know -

Solution 1

It's an issue with authorization. Try this in the Terminal:

sudo DevToolsSecurity -enable

It may ask you to enter your mac password so kindly do that.

Solution 2

Edit Scheme -> Run -> Debug executable

uncheck this checkbox it will be ok!

Upvotes: 7

dimaskpz
dimaskpz

Reputation: 87

Im using macOS M1 Pro, XCode 14.2

I had a problem running iOS simulator.

Solution that worked for me:

Solution 1 (uncheck Rosetta on Xcode 14.2)

  • Quit Xcode
  • Right click on Xcode, press "Get Info"
  • Make sure that "Open using Rosetta" is not selected(see image)
  • Delete derived data(don't know if this is required)
  • Reopen Xcode and run your app

Solution 2

Edit Scheme -> Run -> Debug executable

Check this checkbox

this works for me!

Upvotes: 1

Thermech
Thermech

Reputation: 4451

With Mac M1 you could also exclude arm64 in your target

Target > Build Settings > Excluded Architectures --> add "arm64"

If an update isn’t available from the vendor, temporarily use the EXCLUDED_ARCHS build setting to exclude arm64 for the simulator SDK as shown in the figure below. Do not exclude arm64 for any other SDK.

change this setting only for iOS Simulator

Upvotes: 14

Hem Poudyal
Hem Poudyal

Reputation: 321

I also updated Xcode to 14.0 and MacOS to Ventura, I was getting a similar message.

main_issue

The problem for me was my team member accidentally selected "Wait for the executable to be launched" in our scheme settings. Changing it to "Automatically", worked for me.

Click on your scheme to reveal your schemes and scheme settings.

demo_scheme

Click on Edit Scheme, located at the bottom.

Select the Run option on the left and select Automatically on the Launch section.

run_scheme

Upvotes: 1

Yoannes Geissler
Yoannes Geissler

Reputation: 841

Sometimes I get this issue and the only way I could get it to work was to first run the app on terminal:

npx react-native run-ios

then reopen xcode and run it again..

Upvotes: 0

stackich
stackich

Reputation: 5287

I had a problem running watchOS simulator.

Solution that worked for me:

  • Quit Xcode
  • Right click on Xcode, press "Get Info"
  • Make sure that "Open using Rosetta" is not selected(see image)
  • Delete derived data(don't know if this is required)
  • Reopen Xcode and run your app

img1

Upvotes: 27

Sube Barkhasbadi
Sube Barkhasbadi

Reputation: 1

Set debug under Build Active Architecture Only to Yes

Upvotes: 0

Diego Arena
Diego Arena

Reputation: 111

I was facing the same issue trying to open the Apple Watch Simulator, but I was able to fix it by disabling Rosetta in the xcode.

Mac M1 Xcode 13.4.1 WatchOs 8.5

Upvotes: 11

Related Questions