"Valid signing identity not found."
This error has haunted iOS developers for 15 years. The system Apple uses to secure apps is powerful but notoriously complex. It relies on a file called a Provisioning Profile.
What is a Provisioning Profile?
Think of a Provisioning Profile (`.mobileprovision`) as a VIP pass for your app. It ties together three things:
- Who you are: Your Digital Certificate (p12).
- What the app is: Comparison App ID (Bundle ID).
- Where it can run: A list of device UDIDs (for Ad Hoc/Dev).
The Three Types of Profiles
1. Development Profile
Use case: Debugging on your own phone while plugged into Xcode.
Capabilities: Includes your specific devices. Enables debugging features.
Expiration: 1 year.
2. Ad Hoc Distribution Profile
Use case: Sending a beta to a tester (QA team, client) using a service like BetaDrop.
Capabilities: Does NOT allow debugging (more secure). Requires you to add every single tester's UDID to the profile beforehand.
Expiration: 1 year (or sooner if your certificate expires).
3. App Store Distribution Profile
Use case: Uploading to TestFlight or the App Store.
Capabilities: Contains NO device UDIDs. It authorizes the app to run on *any* device, but only if downloaded through Apple's servers (which wrap it in their own DRM).
The "Missing Profile" Fix
If you are building an app and Xcode says "Profile missing", the easiest fix is usually enabling "Automatically Manage Signing" in your project settings. This lets Xcode talk to Apple's servers and generate a Development profile for you.
However, for CI/CD builds (using Fastlane), you typically need to manage these files manually (Manual Signing) to ensure the build server uses the correct distribution certificate.

