Search code examples
iosxcodemacosxcode14xcode-debugger

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 ?


Solution

  • There was on security software installed in machine which was blocking this simulator to attach.

    To get more information, when we receive that alert we should check in Console.app for our Simulator app process id and notice issues/errors.

    After uninstalling that app, this issue is resolved and able to attach app through debug mode.