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
xcodeOrgIdandxcodeSigningIdcapabilities: - Create a
.xcconfigfile somewhere on your file system and add the following to it: Then use thexcodeConfigFilecapability to specify the path to this 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_TEAMis 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 -subjecthelps for both cases.you@email.comis your Apple ID. The output issubject=UID=UID, CN=Apple Development: you@email.com (USER_TEAM_ID_PAID_ACCOUNT), OU=USER_TEAM_ID_FREE_ACCOUNT, O=acocunt name, C=USformat.USER_TEAM_ID_PAID_ACCOUNTis thexcodeOrgIdfor the paid account. TheUSER_TEAM_ID_FREE_ACCOUNTis for the free account.security find-identity -v -p codesigningprints available accounts for code signing on your local, which are needed to print account details as above.
appium:xcodeSigningId/CODE_SIGN_IDENTITYis usually eitherApple DeveloperoriPhone Developer.appium:updatedWDABundleIdis the bundle id you would like to use for the built WebDriverAgent.- Appium replaces the existing placeholder of
com.facebook.WebDriverAgentRunnerinWebDriverAgent.xcodeprojwith the given capability value. xcodebuildadds.xctrunnerautomatically 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:updatedWDABundleIdisio.appium.WebDriverAgentRunner, the given provisioning profile should be forio.appium.WebDriverAgentRunner.xctrunner,io.appium.WebDriverAgentRunner.*or*.
- For instance, when the
appium:allowProvisioningDeviceRegistrationlets XCUITest driver set-allowProvisioningUpdatesand-allowProvisioningDeviceRegistrationflags for thexcodebuildcommand. They will help register the target device to the matched provisioning profile if it still doesn't have the device. Please checkman xcodebuildoutput for more details.
- Appium replaces the existing placeholder of
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.