54

I can't run any Xcode Swift Playground project without getting the error:

Failed to launch process. Failed to attach to stub for playground execution: error: attach failed ((os/kern) invalid argument)

Does anyone know how to solve this?

JaredH
  • 2,338
  • 1
  • 30
  • 40
Steve Code Brain
  • 663
  • 1
  • 4
  • 6

4 Answers4

112

I've the same issue. If I launch Xcode using rosetta, it doesn't show anything. You must switch off rosetta and it works perfect.

E.P
  • 1,136
  • 1
  • 4
  • 2
  • 11
    are there any other solution, i way to lazy switching from rosetta and not everything I switch from muy prod app and personal app/exercise – Farhandika Jan 10 '22 at 12:15
  • @Farhandika yes, you can have multiple Xcodes. They may even be the same version of Xcode. Just rename the binary. Download from developer.apple.com and not the app store. – Dan Rosenstark Oct 09 '22 at 18:45
24

To expand on @E.P's answer

To put off rosetta Go to Aplications-->Xcode-->Get info --> Uncheck rosetta.
You need to restart the system in some cases

novice
  • 461
  • 4
  • 12
2

Right click on Xcode, Get Info, Uncheck Rosetta. Then quit Xcode from Dock and re open your playground file.

UncheckRosetta

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
0

Applications-->Xcode-->Get info --> Uncheck rosetta and restart system, then it will work perfectly.