macOS: development troubleshooting
Problem: developer mode is not enabled
lldb
debugger refuses to run with message:developer mode is not enabled on this machine and this is a non-interactive debug session
Possible solution:
Enable developer mode with
sudo DevToolsSecurity -enable
Problem:
lldb
orgdb
is not codesignedWhen trying to debug with
lldb
andgdb
they stop with a messageUnable to find Mach task port for process-id
Possible solution:
The
lldb
orgdb
executable must be codesigned. The procedure is explained in lldb docs: code-signing.txtAdditionally, when installing
gdb
using Homebrew (brew install gdb
), it recommends the following:gdb requires special privileges to access Mach ports. You will need to codesign the binary. For instructions, see:
https://sourceware.org/gdb/wiki/BuildingOnDarwin
On 10.12 (Sierra) or later with SIP, you need to run this:
echo “set startup-with-shell off” >> ~/.gdbinit