Why this happens
When you build and run an app from Xcode onto a physical iPhone or iPad, iOS verifies the code signature against a developer certificate stored in a provisioning profile. For free Apple ID accounts and paid Developer Program accounts alike, the first time an app signed with a given certificate lands on a device, iOS marks the profile as untrusted. Until you explicitly approve that profile in Settings, the system blocks the launch and Xcode reports:
Could not launch "My App"
process launch failed: Security
The simulator works because it uses a different code-signing path that does not require user trust. The error typically appears after:
- Upgrading iOS (which can reset trust settings)
- Deleting and reinstalling the app
- Switching between a free Apple ID and a paid team
- Using a new Mac or Xcode installation that generates a new certificate
How to fix it
1. Trust the developer profile in Settings (all current iOS versions)
This is the standard fix for iOS 10 through iOS 17.
- On the iPhone, open Settings.
- Tap General → VPN & Device Management.
– On iOS 15 and earlier the menu is labeled Profiles or Device Management. - Under Developer App, tap the entry that shows your Apple ID (e.g.,
developer@example.com). - Tap Trust “developer@example.com”.
- Confirm by tapping Trust in the alert.
- Return to Xcode and click Run (⌘R) again.
The app should now launch normally.
2. Alternative path for older iOS versions (iOS 9–12)
If the device runs an older iOS version the menu names differ slightly:
- Settings → General → Device Management (or Profiles).
- Select the profile under Developer App.
- Tap Trust and confirm.
3. When the profile does not appear
If you don’t see any entry under Developer App:
- Ensure the iPhone is unlocked and on the Home Screen while Xcode installs the app.
- In Xcode, open Window → Devices and Simulators (⌘⇧2), select the device, and verify the app appears under Installed Apps.
- Delete the app from the device, then in Xcode choose Product → Clean Build Folder (⌘⇧K) and run again.
- After the install attempt, re-check Settings → General → VPN & Device Management; the profile should now be listed.
4. Paid Developer Program: enable “Automatic” signing
For Apple Developer Program members, Xcode can manage signing automatically and avoid repeated trust prompts:
- Select the project in the Project Navigator.
- Choose the target → Signing & Capabilities.
- Check Automatically manage signing.
- Select your Team.
- Connect the device and run; Xcode will register the device and create a profile that persists across rebuilds.
Note: Free Apple ID accounts must re-trust the profile every 7 days because the provisioning profile expires weekly. Paid accounts get profiles valid for one year.
How to prevent it
- Use Automatic Signing with a paid Developer Program account to generate long-lived profiles.
- Keep the device unlocked during the first install so the profile is written immediately.
- Avoid deleting the app between test sessions unless necessary; the trust decision survives app updates.
- Add the device to your team via Xcode’s Devices window (paid accounts) so Xcode can create a proper provisioning profile.
- Update Xcode and iOS together; major OS upgrades sometimes reset trust and require re-approval.
FAQ
Why does the simulator work but my iPhone shows the Security error?
The simulator uses a macOS code-signing identity that macOS already trusts. Physical devices require explicit user approval for each developer certificate because they enforce the same security model as App Store distribution.
I trusted the profile but still get the error after a week.
Free Apple ID provisioning profiles expire after 7 days. When Xcode rebuilds the app it generates a new profile, which must be trusted again. A paid Developer Program membership extends profile validity to one year.
The “VPN & Device Management” section is missing from Settings.
That section only appears when at least one configuration profile (MDM, developer, or VPN) is installed on the device. If it’s absent, the developer profile was never written—re-run the app from Xcode with the device unlocked, then check Settings again.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.
