Debug your Qt apps on macOS in Qt Creator (lldb workaround)

Many developers started complaining that lldb debugger shipped with latest XCode update (12.4) no longer works when trying to debug your app. It can be difficult to diagnose the issue because you only see “Debugger started” and “Debugger finished” message in Qt Creator. By using View->Views->Debugger Log you can actually locate the problem and see the “Not allowed to attach to process” error message. Basically lldb now requires your app to be signed with the get-task-allow entitlement which allows other processes (like the debugger) to attach to your app.

To debug your app after it’s built you need to sign it specifying required entitlements using command line (we run codesign command via QMAKE_POST_LINK):

codesign --entitlements codesign_entitlements_debug.plist ...


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

We also use to allow loading of unsigned Qt frameworks when Qt is compiled manually. In release build frameworks are signed together with the main binary.

Signing with the entitlement must be done only for the debug binary, otherwise your app will be rejected for notarization.