I am getting this error message whenever I try to run any of my iOS projects on the simulator. How do I get rid of this?
I have already tried Cleaning the build folder, and erasing all content and settings of the simulator, tried different simulators as well as closing and starting the Xcode again.
Details
Could not attach to pid : “3386”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: lost connection
User Info: {
DVTRadarComponentKey = 855031;
RawUnderlyingErrorMessage = "lost connection";
}
--
System Information
macOS Version 12.0 (Build 21A5304g)
Xcode 12.5.1 (18212) (Build 12E507)
Timestamp: 2021-08-25T12:20:16+05:00
4
Answers
It might be an issue with authorization, Try below lines in terminal.
sudo DevToolsSecurity -enable
This problem might be related to the beta version of macOS that you use.
I suggest using the Xcode 13 Beta from Apple for developers.
You need a free apple developer account to access this download.
For me this solved all problems.
Untick the debug executable.
Edit Scheme > Run > Debug executable
Was getting this error in the console:
com.apple.debugserver) may not get the task control port of (appName) (pid: 1976): (appName) is hardened, (appName) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger
Set Build settings of
CODE_SIGN_INJECT_BASE_ENTITLEMENTS
to YES for Debug Level.