Could not attach to pid : “15790” が出た

いきなりこんなエラーが出てしまうようになりました。

どうやら認証の問題のようで以下のコマンドを実行することで解決することができました。

sudo DevToolsSecurity -enable

エラーの内容

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.)

参考文献

Xcode: Could not attach to pid