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 am using MacOS 12.0 beta and Xcode 12.5.1 from App Store and have same problem. Edit Scheme -> Run -> unchecking Debug excitable worked for me.

Just like @mitas95, I'm also having the same issue on an M1 Mac. The only thing that worked for me was Product>Scheme>Edit Scheme>Run>[ ] Debug Executable, which is unideal.

Deleting DerivedData, closing and reopening Xcode did the trick for me on Xcode 12.5.1

I have fixed this by fixing certifications. the project was manually set with provisioning profiles and maybe the wrong development account. I solved it be deleting all hard coded provisioning profiles and making all signing auto, and then select the suitable developer account.

I hope this helps!

Muhamad Akoum aka. Ancient Prayers ancientprayers.com

For me this scenario happened after a merge. The Solution was to remove an environment variable in Edit Scheme-> Run-> Arguments. I removed the environment variable and then added it again. That solved the issue.

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