久しぶりにMacアプリのプロジェクトを開いて実行しようとしたら以下のようなエラーでデバッガ接続できなくなっていました。
Could not attach to pid : “1948” 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 attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) User Info: { DVTRadarComponentKey = 855031; RawUnderlyingErrorMessage = "attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)"; }
色々調べた結果、Build Settingsの Enable Hardened Runtime
が Yes
になっていました。この設定は Apple の公証を取得するために必要なんですが、Debug実行では必要ないので、 No
にします。
するとエラーにならずデバッグ実行できるようになりました。