Configure Xcode
To begin, let’s introduce some key concepts:
Bundle Identifier
This is a unique identifier assigned to your app, typically in reverse domain name notation (e.g., com.yourcompany.yourapp). It ensures that no two apps share the same identifier.
Team ID
An Apple Developer Team ID is a unique 10-character alphanumeric identifier assigned by Apple to your development team.
App ID
This identifier comprises a Team ID (assigned by Apple to your development team) and a Bundle Identifier search string. It associates your app with specific services and capabilities, such as push notifications or iCloud or more importantly for us the associated domains.
1. Xcode setup
We need to configure a few settings in Xcode:
Open your project in Xcode
- Navigate to your flutter project directory in Finder then to your
ios
directory - Open
Runner.xcworkspace
Go to Signing & Capabilities
Go to the Signing & Capabilities tab
Select your Apple ID account
Under Team, select your Apple ID account
Set Bundle Identifier
Set a unique Bundle Identifier for your app
- For example:
com.yourname.myapp
This needs to be globally unique across all apps in the App Store
Enable automatic signing
Check Automatically manage signing
so Xcode takes care of configuring everything for you
2. Register your device
Xcode needs to register your iPhone as a development device:
Connect your iPhone
Connect your iPhone to your Mac via a USB cable
Trust the computer
If it is the first time you connect, you may need to tap “Trust this computer” on your iPhone and enter your passcode
Select run target
In the top bar, select your connected iPhone from the device list as the run target
Register device
If this is your first time using the device for development, Xcode will register it automatically