Xcode
iOS Development
get-task-allow
App Security
Debugging

What does the get-task-allow entitlement do in Xcode?

Codemia Knowledge Hub ·

get-task-allow is a boolean entitlement in an iOS or macOS app's code signature that controls whether other processes, such as the debugger, can attach to the app. When it is true, Xcode's LLDB can connect, inspect memory, set breakpoints and control execution. Development builds have it set to true by default, and App Store distribution builds have it false for security. If it is misconfigured, debugging fails or the App Store rejects the submission.

What the entitlement allows

xml
<!-- In your app's entitlements file (*.entitlements) -->
<key>com.apple.security.get-task-allow</key>
<true/>  <!-- Allows debugger attachment -->

When get-task-allow is true:

  • Xcode's LLDB debugger can attach to the running process
  • Instruments can profile the app
  • Other developer tools can inspect the process
  • The app can be debugged on a physical device via Xcode

When it is false:

  • No external process can attach to the app
  • Debugging is disabled
  • The app is hardened against runtime inspection
  • Required for App Store and enterprise distribution

How Xcode sets it for you

Xcode controls get-task-allow through build configurations and provisioning profiles:

 
1Debug build configuration:
2  → Uses Development provisioning profile
3  → get-task-allow = true
4  → Debugger can attach
5
6Release build configuration:
7  → Uses Distribution provisioning profile
8  → get-task-allow = false
9  → Debugger cannot attach

You normally never set it by hand. Automatic code signing handles it from the selected scheme and provisioning profile. Adding it manually to the .entitlements file can conflict with the profile and cause code signing failures.

The relevant build settings:

 
1Xcode Build Settings:
2  CODE_SIGN_IDENTITY
3    Debug:   "Apple Development"
4    Release: "Apple Distribution"
5
6  PROVISIONING_PROFILE_SPECIFIER
7    Debug:   "MyApp Development"
8    Release: "MyApp Distribution"
9
10  CODE_SIGN_ENTITLEMENTS
11    Both:    "MyApp/MyApp.entitlements"
12
13Xcode automatically strips get-task-allow from Release builds
14when using "Apple Distribution" identity.

Checking the entitlement on a build

bash
1# Check entitlements on a built .app bundle
2codesign -d --entitlements - /path/to/MyApp.app
3
4# Output for a debug build:
5# <key>com.apple.security.get-task-allow</key>
6# <true/>
7
8# Output for a release/distribution build:
9# get-task-allow is absent or false
10
11# Check an IPA file
12unzip -o MyApp.ipa -d /tmp/app_contents
13codesign -d --entitlements - /tmp/app_contents/Payload/MyApp.app

Errors caused by get-task-allow

App Store upload rejected over get-task-allow

 
1ERROR ITMS-90164: "Invalid Code Signing Entitlements.
2The entitlements in your app bundle signature do not match
3the ones in the provisioning profile.
4Value for get-task-allow entitlement not supported."

This rejection means the build was signed with get-task-allow = true: a Debug build, or one signed with a Development profile. Archive with the Release configuration and a Distribution provisioning profile instead.

Cannot attach the debugger on a device

 
Could not attach to pid: "1234"

The provisioning profile may not include get-task-allow. Check that:

  1. You are using a Development provisioning profile
  2. The device is registered in your Apple Developer account
  3. The build configuration is Debug, not Release

Ad-hoc builds signed with a Development profile

Ad-hoc and enterprise distribution profiles set get-task-allow = false. Using a Development profile for ad-hoc builds includes the entitlement and may cause installation failures on non-registered devices.

Re-signing an app for testing

bash
1# Re-sign an IPA with get-task-allow enabled for testing
2# First, create an entitlements file
3cat > entitlements.plist << 'EOF'
4<?xml version="1.0" encoding="UTF-8"?>
5<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
6  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7<plist version="1.0">
8<dict>
9    <key>com.apple.security.get-task-allow</key>
10    <true/>
11</dict>
12</plist>
13EOF
14
15# Re-sign the app
16codesign -f -s "iPhone Developer: Your Name" \
17  --entitlements entitlements.plist \
18  /path/to/MyApp.app

macOS Hardened Runtime and notarization

On macOS, get-task-allow interacts with the Hardened Runtime:

xml
1<!-- macOS entitlements for development -->
2<key>com.apple.security.get-task-allow</key>
3<true/>
4
5<!-- This is separate from the hardened runtime flag -->
6<!-- Hardened Runtime is required for notarization -->

Apps notarized for distribution outside the App Store need the Hardened Runtime enabled and get-task-allow set to false. The notarization service rejects builds with get-task-allow = true because it weakens the Hardened Runtime. During development, Xcode adds get-task-allow = true automatically even with the Hardened Runtime enabled.

Archiving correctly in CI

Build scripts that default to the Debug configuration produce binaries with get-task-allow = true, so always pass -configuration Release when archiving:

bash
1# In CI, ensure the correct configuration is used for archiving
2xcodebuild archive \
3  -scheme MyApp \
4  -configuration Release \
5  -archivePath build/MyApp.xcarchive
6
7# Export for App Store
8xcodebuild -exportArchive \
9  -archivePath build/MyApp.xcarchive \
10  -exportPath build/export \
11  -exportOptionsPlist ExportOptions.plist
xml
1<!-- ExportOptions.plist for App Store -->
2<plist version="1.0">
3<dict>
4    <key>method</key>
5    <string>app-store</string>
6    <key>teamID</key>
7    <string>YOUR_TEAM_ID</string>
8</dict>
9</plist>

The method: app-store export option strips get-task-allow from the final binary.


Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design