Basic Automatic Configuration

If you have a paid Apple Developer account, the easiest way to create the provisioning profile is to use the automatic configuration strategy. There are two ways to do this:

  • Use the xcodeOrgId and xcodeSigningId capabilities:
    {
      "appium:xcodeOrgId": "<Team ID>",
      "appium:xcodeSigningId": "Apple Developer",
      "appium:updatedWDABundleId": "<bundle id your provisioning profile can accept>"
    }
    
  • Create a .xcconfig file somewhere on your file system and add the following to it:
    DEVELOPMENT_TEAM = <Team ID>
    CODE_SIGN_IDENTITY = Apple Developer
    
    Then use the xcodeConfigFile capability to specify the path to this file:
    {
      "appium:xcodeConfigFile": "/path/to/xcconfig/file"
    }
    

Note that these are mutually exclusive strategies; use either the appium:xcodeConfigFile capability or the combination of appium:xcodeOrgId and appium:xcodeSigningId.

  • appium:xcodeOrgId / DEVELOPMENT_TEAM is a unique 10-character string generated by Apple that is assigned to your team.
    • Paid account only: To find this string, sign in to developer.apple.com/account, and click Membership in the sidebar. Your Team ID appears in the Membership Information section under the team name. You can also find your Team ID listed under the "Organizational Unit" field in your iPhone Developer certificate in your keychain.
    • Paid account and free account: The result of security find-certificate -c "Apple Development: you@email.com" -p | openssl x509 -noout -subject helps for both cases. you@email.com is your Apple ID. The output is subject=UID=UID, CN=Apple Development: you@email.com (USER_TEAM_ID_PAID_ACCOUNT), OU=USER_TEAM_ID_FREE_ACCOUNT, O=acocunt name, C=US format. USER_TEAM_ID_PAID_ACCOUNT is the xcodeOrgId for the paid account. The USER_TEAM_ID_FREE_ACCOUNT is for the free account. security find-identity -v -p codesigning prints available accounts for code signing on your local, which are needed to print account details as above.
  • appium:xcodeSigningId / CODE_SIGN_IDENTITY is usually either Apple Developer or iPhone Developer.
  • appium:updatedWDABundleId is the bundle id you would like to use for the built WebDriverAgent.
    • Appium replaces the existing placeholder of com.facebook.WebDriverAgentRunner in WebDriverAgent.xcodeproj with the given capability value.
    • xcodebuild adds .xctrunner automatically for XCTest package. Thus, the provisioning profile you're using should have the suffix explicitly, or it can be for bundle id which has *.
      • For instance, when the appium:updatedWDABundleId is io.appium.WebDriverAgentRunner, the given provisioning profile should be for io.appium.WebDriverAgentRunner.xctrunner, io.appium.WebDriverAgentRunner.* or *.
    • appium:allowProvisioningDeviceRegistration lets XCUITest driver set -allowProvisioningUpdates and -allowProvisioningDeviceRegistration flags for the xcodebuild command. They will help register the target device to the matched provisioning profile if it still doesn't have the device. Please check man xcodebuild output for more details.

Once this configuration is done, you should specify your real device UDID with the udid desired capability, after which you should be able to start your session. Check Common Issues if you encountered any problems.