I'm building my app with Xcode using Release configuration for production:
But then when I check the resulting binary for entitlements:
codesign -d --entitlements - --xml /Users/user/Library/Developer/Xcode/DerivedData/LABService-emdoarcsbzcuepbrkkkpbcckcaqx/Build/Products/Release/MyAppName
I'm getting:
Executable=/Users/user/Library/Developer/Xcode/DerivedData/LABService-emdoarcsbzcuepbrkkkpbcckcaqx/Build/Products/Release/MyAppName
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>
How do I remove the com.apple.security.get-task-allow entitlement from the release build (but keep it for the debug config build)?

OK, answering my own question. The
com.apple.security.get-task-allowentitlement will be automatically removed when you code-sign the binary. I'm not sure if it will be done with thecodesigncommand line tool, but the Xcode does it from the UI.