Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 14 is not getting attached to Simulator in Debug mode

While debugging any iOS application, Xcode builds and run successfully, also launches a simulator but it is not able to attach debugger from Xcode 14 to Simulator iOS app.

It throws an error in Xcode:

enter image description here

Xcode console says:

Could not attach to pid : “75997” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) User Info: { DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)"; }

Tried with re-installing Xcode and Command line tools, but issue persists.

Steps:

  • Build and run app with Debug executables true
  • Simulator gets launched
  • Error on Xcode and it gets disconnected from simulator

Is there a possibility that it can be blocked by any other app, if so how to identify ?

like image 813
Mrunal Avatar asked Jan 28 '26 14:01

Mrunal


1 Answers

Came here to share my (strange) solution if anybody crosses the same problem with no answers working. In my case, no solution from this nor other SO answers to similar questions worked (cleaning, rebuilding project, updating, clearing derived data..)

My setup is:

Macbook M1 2022 + Xcode Version 14.2 (14C18)

This Xcode version could not attach to any of my apps (fresh new or previously developed) on different simulators (11, 12, 14) with iOS versions 13.7 - 16.2.

Editing scheme solution from answer above was not working also so I ended up in leaving scheme as:

Build configuration: Release
Debug executable Deselected(!)
Launch Automatically

edit scheme window

And magically debugging app in Xcode started working even though it's release version with debug option deselected.. Selecting Debug executable again makes Xcode not possible in attaching to app process


Just to clarify: above steps actually makes app to run as in DEBUG mode - Xcode attaches to pid, I can do console logs and breakpoints. This Xcode version behaves opposite than options selected

scheme_with_console_logs

like image 161
deevee Avatar answered Jan 30 '26 03:01

deevee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!