Xcode: Could not attach to pid

Every single time I try to launch the simulator I get this:


Cold not attach to pid : "12345"

Domain: IDEDebugSessionErrorDomain

Code: 3

Failure Reason: Error 1

--

Error 1

Domain: IDEDebugSessionErrorDomain

Code: 3

--


I'd REALLY like to be able to debug. Can anyone offer some help?


On google, I found suggestions to build it again, to restart xcode, to restart Xcode and rebuild, to reboot the computer, to set to release instead of debug. NONE of thelse things helped in any way. 😟


-Verxion

Answered by Hunter in 373436022

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


sudo DevToolsSecurity -enable

I've done everything posted here, but still get this all the time. For me, I'm working on an Intents Extension and that seems to be causing it. Running the main app target or another extension doesn't cause this problem.

I was able to fix it briefly by removing the dev certificates from my keychain and re-adding them, but now that no longer seems to work.

Could really use some Apple input here.

make sure your push message payload contain this ""mutable-content":1".only this OS will call method -(void) didReceiveNotificationRequest:withContentHandler:

I had the same issue like @darrylfromredwoodcity described. My problem was that I hat installed multiple versions of Xcode and the wrong Command Line Tools were selected.

Changing the CLT fixed it for me: Xcode > Preferences > Location > Command Line Tools -> Select correct version

Also happens on a brand new M1 Max with the latest stable OS (12.12.1) and XCode (13.2.1) when creating a completely new Watch App.

happening for m1 pro and debugging a desktop app with xcode 12.3. I have tried all solutions mentioned in this thread but to no avail. I am able to to atttach it after edit Scheme -> Run -> Debug executable but i have the need to debug the app. any suggestions are welcome.

@ tintin7 2 Edit scheme -> Run -> Info -> Debug Process As -> select root

I solved that just command+shift+k ,

I have this problem ONLY when debugging Photo Extensions and ONLY since upgrading to Ventura. Of course I tried all suggestions here: Developer Mode enabled ➔ Of Course as I can debug everything except Photo Extension Debug Executable is off, Command Line Tools are set correctly etc. as the only variable was the upgrade from Monterey to Ventura.

I have tried everything I could find on the topic, so I am very grateful for any suggestions!!

All the best Christoph

Xcode: Could not attach to pid
 
 
Q