Maintaining Identifiers, Devices, and Profiles

You use Member Center to manage the identifiers, devices, and profiles used to code sign your app, enable it to launch on devices, and use certain technologies and services. Xcode creates and manages these assets for you during development. When you’re ready to distribute your app for testing, you use Member Center to manage some of these assets yourself. For example, you use Member Center to create your ad hoc and store provisioning profiles. Also, you might want to upload a list of devices used for testing, not register them individually. This chapter covers miscellaneous tasks you perform to maintain identifiers, devices, and profiles.

For how to use Website Push IDs, read Notification Programming Guide for Websites.

Registering App IDs

You can create a wildcard App ID that matches one or more apps or an explicit App ID that exactly matches your bundle ID. The technologies enabled for an App ID serve as a white list of the technologies one or more apps may use. What technologies an app actually uses is configured in the Xcode project. You can enable technologies when you create an App ID or modify these settings later. Game Center and In-App Purchase are enabled by default for an explicit iOS App ID. In-App Purchase is enabled by default for an explicit Mac App ID.

In most cases, the wildcard and explicit App ID that Xcode creates for you when you add capabilities to your app, as described in “Adding Capabilities,” are sufficient to develop, test, and distribute your app. There can be only one explicit App ID per app, so if one already exists, Xcode uses it to create team provisioning profiles on your behalf.

bullet
To register an App ID
  1. In Member Center, select Certificates, Identifiers & Profiles.

  2. Under Identifiers, select App IDs.

  3. Click the Add button (+) in the upper-right corner.

    ../Art/13_createappID_1.png
  4. Enter a name or description for the App ID in the Name field.

    ../Art/13_createappID_2_2x.png
  5. To create an explicit App ID, select Explicit App ID and enter the app’s bundle ID in the Bundle ID field.

    An explicit App ID exactly matches the bundle ID of an app you’re building—for example, com.example.gitakumar.adventure. An explicit App ID can’t contain an asterisk (*).

    ../Art/13_createappID_4_2x.png

    If you entered a bundle ID in the target’s Summary pane in Xcode, the App ID you enter here should match your bundle ID.

  6. To create a wildcard App ID, select Wildcard App ID and enter a bundle ID suffix in the Bundle ID field.

    ../Art/13_createappID_5_2x.png
  7. Select the corresponding checkboxes to enable the technologies you want to use, and click Continue.

    A checkbox is disabled if the technology requires an explicit App ID and you’re creating a wildcard App ID, or the technology is enabled by default.

    ../Art/13_createappID_3_2x.png
  8. Review the registration information, and click Submit.

  9. Click Done.

Editing App IDs

For technologies you can’t enable using Xcode, you can edit an App ID directly using Member Center. To enable technologies for one or more apps, edit the corresponding App ID in Member Center.

bullet
To enable technologies for an existing App ID
  1. In Member Center, select Certificates, Identifiers & Profiles.

  2. Under Identifiers, select App IDs.

  3. Select the App ID you want to change, and click Edit.

  4. Select the corresponding checkboxes to enable the technologies you want to allow.

    ../Art/13_enable_technologies_2x.png
  5. If a warning dialog appears, click OK.

    Later, you’ll regenerate the provisioning profiles that use the App ID.

  6. Click Done.

To fully enable push notifications, read “Configuring Push Notifications.”

Deleting App IDs

You can also remove App IDs when you no longer need them.

bullet
To remove an App ID
  1. In Member Center, select Certificates, Identifiers & Profiles.

  2. Under Identifiers, select App IDs.

  3. Select the App ID you want to delete and then click Edit.

    ../Art/13_deleting_appIDs_2x.png
  4. Scroll to the bottom of the page and click Delete.

  5. Read the dialog that appears and click Delete.

Provisioning profiles that contain a deleted App ID become invalid. You can change the App ID in the provisioning profiles, as described in “Editing Provisioning Profiles in Member Center,” or delete them.

Locating Your Team ID

Occasionally, you may need to know your Team ID. For example, if you want to receive an app from another developer, the developer needs your Team ID to initiate the app transfer in iTunes Connect. The Team ID is a unique 10-character string generated by Apple that’s assigned to your team. You can find your Team ID using Member Center.

bullet
To locate your Team ID
  • In Member Center, select Your Account.

    Your Team ID appears in the Developer Account Summary section under the team name.

    ../Art/13_locate_teamid_2x.png../Art/13_locate_teamid_2x.png

Registering Devices Using Xcode

Xcode needs one or more devices registered with the Member Center to create the team provisioning profile and for you to run an app on a device. Xcode automatically registers your Mac or a connected iOS device that’s enabled for development and chosen from the destination Scheme pop-up menu in the project editor. However, if an iOS device isn’t enabled for development, it doesn’t appear in this menu. In this case, use the Devices organizer to enable it. You can register it with Member Center using the Devices organizer, too.

You can register development devices using either Xcode or Member Center. Use Xcode to register individual devices that you have access to, and later use Member Center to register multiple devices for beta testing, as described in “Registering Devices Using Member Center.”

bullet
To provision your device for development
  1. To display the Devices organizer in Xcode, choose Window > Organizer, and click Devices.

  2. For an iOS app, connect your device to your Mac.

  3. In the Devices section, select your device.

  4. Click the “Use for Development” or “Add to Member Center” button.

    If the device was previously used for development, the “Use for Development” button doesn’t appear. If this happens, click “Add to Member Center” at the bottom of the window instead.

    ../Art/5_usefordevelopment_2x.png
  5. Select the checkbox next to your account name, and click Choose.

    ../Art/5_addtoportal_2x.png
  6. If a Certificate Not Found dialog appears, click Request.

    Xcode offers to request your development certificate depending on whether your app is for iOS or Mac. If you’re an individual developer, wait while Xcode submits the request. iOS developers need an iOS Development certificate, and Mac developers need a Mac Development certificate to proceed.

If needed, Xcode creates your team provisioning profile.

Registering Devices Using Member Center

In Member Center, you can register devices individually as needed or upload a file with information on multiple devices. Each year, you’re allowed to register a fixed number of devices. The maximum number of devices you can register is 100 per membership year. If you later disable a device, as described in “Disabling and Enabling Devices Using Member Center,” it doesn’t decrease your count of registered devices.

Locating Device IDs

You need the name and device ID for each device you want to register. There are several ways to obtain device IDs depending on whether you have Xcode installed.

Locating Device IDs Using Xcode

In Xcode, a team member can select a device in the Devices organizer to display the device ID.

bullet
To locate your device ID using Xcode
  1. Choose Window > Organizer.

  2. In the Devices organizer under Devices, select your device (your Mac is a device too).

    ../Art/11_deviceid_2x.png
  3. Select and copy the text in the Identifier field.

Locating iOS Device IDs Using iTunes

For iOS devices, you can also obtain a device ID using iTunes. For example, testers follow these steps to get their device ID using iTunes when they don’t have Xcode installed.

bullet
To get a device ID using iTunes
  1. Launch iTunes on your Mac.

  2. Connect your device to your Mac.

  3. In the upper-right corner, select the device.

  4. In the Summary pane, click the Serial Number label under Capacity or Phone Number.

    The label Serial Number changes to Identifier and displays the device ID.

    ../Art/13_itunesgetdeviceid_2x.png
  5. Copy the device ID by Control-clicking the identifier and choosing Copy Identifier (UDID).

    If the menu contains a Copy Serial Number menu item, repeat steps 4 and 5 again.

  6. Paste the device ID in a document or an email message.

Locating Mac Device IDs Using System Preferences

For Mac apps, you can get a device ID using the System Information app. For example, use this method if you want to register a Mac for testing that isn’t used for development.

bullet
To locate your Mac device ID using System Information
  1. Open the System Information app located in the /Applications/Utilities folder.

  2. Select Hardware in the left column.

The device ID, or hardware UUID, appears near the bottom of the Hardware Overview pane and is in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.

Registering Individual Devices

To register a device using Member Center, you need to have the device name and device ID.

bullet
To register a single device
  1. Under Devices, select All.

  2. Click the Add button (+) in the upper-right corner.

  3. Select Register Device.

  4. Enter a device name and the device ID (UDID).

    ../Art/13_ios_adddevice_onportal_2x.png
  5. Scroll to the bottom of the page, and click Continue.

  6. Review the registration information, and click Submit.

Registering Multiple Devices

If you have many test devices, you can create a file containing the device names and device IDs and upload the entire file to Member Center. Member Center supports these two file formats: a property list file with a .deviceids file extension and a plain text file. The file format you choose depends on whether you have access to the devices you want to register.

Creating a Property List Devices File

If you have access to the testing devices, you can use iPhone Configuration Utility to create a property list file that contains the device names and device IDs of the devices you connect to your Mac.

bullet
To download iPhone Configuration Utility
  1. Scroll down to the iPhone Configuration Utility section.

  2. Click the appropriate download link and follow the online instructions.

bullet
To create the devices file using iPhone Configuration Utility
  1. Launch iPhone Configuration Utility.

  2. Connect each device to your Mac in turn.

    iPhone Configuration Utility adds the device information to the Devices section under Library.

  3. Select Devices under Library and select the devices you want to add to the file.

  4. Click Export in the toolbar.

  5. Enter a filename in the Save As field.

  6. Choose Device UDIDs from the “Export type” pop-up menu.

  7. Click Save.

Creating a Plain Text Devices File

If you don’t have access to the testing devices, you can create a .txt file containing the device names and device IDs you collect using another method. In this case, create a tab-delimited file with one device ID and one device name in each row. You can use the first row for your headers, because that row is ignored when parsed.

Uploading the Devices File

In Member Center, the steps to upload the devices file are the same for both file formats.

bullet
To register multiple devices
  1. Under Devices, select All.

  2. Click the Add button (+) in the upper-right corner.

  3. Select Register Multiple Devices.

  4. Click Choose File.

    ../Art/13_ios_addmultidevices_onportal_2x.png
  5. Select the file you want to upload, and click Choose.

    Select either the .deviceids or .txt file you created earlier.

  6. Click Continue.

  7. Review the registration information, and click Submit.

Installing iOS Developer Previews on Your Device

Before you begin, download the iOS developer preview you want to install on your device from iOS Dev Center.

bullet
To install an iOS developer preview on your development device
  1. Connect your device to your Mac.

  2. In the Devices organizer under Devices, select your device and under Software Version, click “Restore using iTunes.”

  3. In iTunes, Option-click the Restore iPhone/iPad/iPod button in the Summary pane.

  4. Select the iOS beta software restore image and click Open to begin installation.

  5. When installation is complete, activate the device and restore its contents using iTunes.

  6. Back in Xcode, click “Use for Development” in the Devices organizer to reenable the device for development.

Disabling and Enabling Devices Using Member Center

You can disable and enable a device, but you can’t delete it from Member Center. You can disable a device you no longer use for development or testing. However, doing so invalidates provisioning profiles that contain the device and doesn’t increase your total count of devices for the year. You can also enable a device that you previously disabled.

bullet
To disable or enable a device
  1. Under Devices, select All.

  2. Select the device you want to disable or enable.

  3. Click either Enable or Disable.

    ../Art/13_disable_device_2x.png
  4. In the dialog that appears, click either Enable or Disable again.

To regenerate invalid team provisioning profiles after disabling a device, read “Refreshing Provisioning Profiles in Xcode.” To remove a disabled device from other provisioning profiles you manage, read “Editing Provisioning Profiles in Member Center.”

You can also enable a device using Xcode. For iOS apps, Xcode automatically registers a connected device that’s enabled for development and chosen from the destination Scheme pop-up menu in the project editor. For Mac apps, Xcode automatically registers the Mac that’s running Xcode. If the device or Mac was previously registered but is disabled, Xcode enables it.

You may still run your app on a disabled device if it is in an older version of a provisioning profile that is installed on the device. To remove old versions of your provisioning profiles, read “Removing Provisioning Profiles from Devices.”

Creating Provisioning Profiles Using Member Center

You can create both development and distribution provisioning profiles yourself using Member Center. To create an ad hoc provisioning profile for testing an iOS app, read “Creating Ad Hoc Provisioning Profiles.” To create a store provisioning profile, read “Creating Store Provisioning Profiles.” Because Xcode creates and manages team provisioning profiles for you, you only create a development provisioning profile if you want to restrict development of an app to specific team members and devices. Follow the steps in this section if you want to create your own development provisioning profile.

Before creating a development provisioning profile, verify that you have an App ID, one or more development certificates, and one or more devices. If you want to register your own App ID, read “Registering App IDs.” (You can also use one of the App IDs that Xcode manages for you.) If you need to create your development certificate, read “Requesting Signing Identities.” If you need to register devices, read “Registering Devices Using Xcode” or “Registering Devices Using Member Center.”

bullet
To create a development provisioning profile
  1. In Certificates, Identifiers & Profiles, select Provisioning Profiles.

  2. Click the Add button (+) in the upper-right corner.

  3. Select iOS App Development for iOS apps or Mac App Development for Mac apps as the distribution method, and click Continue.

    ../Art/13_ios_createdevelopmentprofile_1_2x.png
  4. Select the App ID you want to use for development, and click Continue.

  5. Select one or more development certificates, and click Continue.

  6. Select one or more devices, and click Continue.

  7. Enter a profile name, and click Generate.

  8. Click Done.

After creating your provisioning profile, refresh provisioning profiles in Xcode, as described in “Refreshing Provisioning Profiles in Xcode.”

Refreshing Provisioning Profiles in Xcode

Changes you make in Member Center aren’t automatically reflected in Xcode. For example, if you create or edit a provisioning profile in Member Center, refresh provisioning profiles in Xcode to download the changes. If you revoke a development certificate, refresh provisioning profiles to regenerate team provisioning profiles managed by Xcode. When Xcode refreshes provisioning profiles, it also checks to see if you’re missing signing identities and may ask if you want to request them.

bullet
To refresh provisioning profiles in Xcode
  1. In the Xcode Preferences window, click Accounts.

  2. Select your team, and click View Details.

    ../Art/13_viewdetails2_2x.png../Art/13_viewdetails2_2x.png
  3. In the dialog that appears, click the Refresh button in the lower-left corner under the Provisioning Profiles table.

    Xcode updates the list of profiles in the Provisioning Profiles table.

    ../Art/13_viewdetails3_2x.png../Art/13_viewdetails3_2x.png

Editing Provisioning Profiles in Member Center

You don’t need to re-create provisioning profiles to edit them. You can change the name of a provisioning profile and other properties depending on the type of provisioning profile. For all types of provisioning profiles, you can change the App ID. For an iOS app, you can add devices to an ad hoc provisioning profile. If you change a provisioning profile, remember to replace instances of the provisioning profile that you installed on devices.

If you want to repair a provisioning profile because you re-created a certificate, follow the steps in “Re-Creating Certificates and Updating Related Provisioning Profiles.”

bullet
To edit a provisioning profile
  1. In Certificates, Identifiers & Profiles, select Provisioning Profiles.

  2. Under Provisioning Profiles, select All.

  3. Select the provisioning profile you want to modify, and click Edit.

    ../Art/13_tb_ios_modify_profile1_2x.png
  4. Make your changes to the provisioning profile, such as changing its name, adding certificates, or selecting a different set of devices.

    ../Art/13_tb_ios_modify_profile2_2x.png
  5. Click Generate.

    After the profile is generated, you can download the profile or refresh provisioning profiles in Xcode.

Renewing Expired Provisioning Profiles

If a provisioning profile expires, the provisioning profile’s status displays Expired in Member Center. You renew an expired provisioning profile by editing and re-generating it, as described in “Editing Provisioning Profiles in Member Center.” You don’t need to make any changes to the provisioning profile. Just scroll to the bottom of the “Edit iOS Provisioning Profile” or “Edit Mac Provisioning Profile” page and click Generate.

../Art/13_expired_profile_2x.png

If the expired provisioning profile is installed on your device, remove it, as described in “Removing Provisioning Profiles from Devices.” If the provisioning profile is an ad hoc provisioning profile, then re-sign and distribute your app using the regenerated provisioning profile, as described in “Beta Testing Your iOS App.”

Removing Provisioning Profiles from Devices

You remove expired or invalid provisioning profiles from devices as needed. Use Xcode to remove provisioning profiles from iOS devices and if necessary, System Preferences to remove them from Macs.

bullet
To remove a provisioning profile from an iOS device using Xcode
  1. Connect your iOS device to your Mac.

  2. To display the Devices organizer in Xcode, choose Window > Organizer, and click Devices.

  3. Select the disclosure triangle next to your device under Devices to reveal the contents.

  4. Select Provisioning Profiles in the left column under your device.

  5. Select the provisioning profile you want to delete on the right.

    ../Art/13_ios_device_delete_profile_2x.png
  6. Click Delete.

  7. In the dialog that appears, click Delete.

On OS X, provisioning profiles that are embedded in app bundles do not appear in System Preferences. However, if you download a provisioning profile from Member Center and double-click it to install it yourself, it will appear in System Preferences. To remove profiles from a Mac, open System Preferences, select Profiles under System, select the profile, and click the Delete button (–) in the lower-left corner.

../Art/13_mac_sysprefs_profiles_2x.png../Art/13_mac_sysprefs_profiles_2x.png

Removing Provisioning Profiles from Member Center

Occasionally, you may need to remove a provisioning profile from your team.

bullet
To remove a provisioning profile from your team
  1. In Certificates, Identifiers & Profiles, select Provisioning Profiles.

  2. Under Provisioning Profiles, select All.

  3. Select the provisioning profile you want to remove.

  4. Click Delete.

    ../Art/13_ios_delete_profile_2x.png
  5. In the dialog that appears, click Delete.

After doing so, refresh provisioning profiles, as described in “Refreshing Provisioning Profiles in Xcode,” and remove the provisioning profile from your devices, as described in “Removing Provisioning Profiles from Devices.”

Downloading Provisioning Profiles from Member Center

If necessary, you can download specific provisioning profiles directly from Member Center.

bullet
To download a provisioning profile
  1. In Certificates, Identifiers & Profiles, select Provisioning Profiles.

  2. Under Provisioning Profiles, select All.

  3. Select the ad hoc provisioning profile.

  4. Click Download.

    ../Art/13_ios_downloadprofile_2x.png

    A file with the provisioning profile name and the .mobileprovision extension appears in your Downloads folder.

Verifying That Your Team Provisioning Profile Is Installed on Your Device

Occasionally, your app may not launch on a device because the provisioning profile installed on the device is incorrect. Use Xcode to examine the provisioning profiles on your iOS device.

bullet
To verify that a provisioning profile is installed on your iOS device
  1. Connect your iOS device to your Mac.

  2. To display the Devices organizer in Xcode, choose Window > Organizer, and click Devices.

  3. Click the disclosure triangle next to your device under Devices.

  4. Select Provisioning Profiles under your device.

    Your provisioning profile should be listed in the detail area with the status “Valid profile.”

    ../Art/13_ios_teamprofile_ondevice_2x.png../Art/13_ios_teamprofile_ondevice_2x.png

On OS X, provisioning profiles that are embedded in app bundles do not appear in System Preferences. However, if you download a provisioning profile from Member Center and double-click it to install it yourself, it will appear in System Preferences.

bullet
To verify that your provisioning profile is installed on your Mac using System Preferences
  1. Launch System Preferences.

  2. Select Profiles under System.

    If you have one or more profiles installed, a Profiles icon appears; otherwise, it doesn’t.

  3. Select a provisioning profile under Provisioning Profiles.

    Verify that your provisioning profile is valid. The provisioning profile is valid if it hasn’t expired and the text “Verified” appears under the name of the provisioning profile.

    ../Art/13_mac_sysprefs_profiles_2x.png../Art/13_mac_sysprefs_profiles_2x.png

Verifying the App Binary Entitlements

Some entitlements (for example, App Sandbox entitlements) are set in your Xcode project and others are set in the provisioning profile. You can check if the signed app has the correct entitlements by examining the app’s signature and if discrepancies occur, by examining the embedded provisioning profile located in the app binary.

bullet
To verify the entitlements of a signed app
  1. In Xcode, select your project in the project navigator.

  2. Click the disclosure triangle next to the project to reveal its contents.

  3. Click the disclosure triangle next to Products to reveal the binary.

  4. Control-click the binary and select “Show in Finder” to go to the Xcode build location in the Finder.

    ../Art/13_locateprofileinbinary_1_2x.png../Art/13_locateprofileinbinary_1_2x.png
  5. Launch Terminal (located in ~/Applications/Utilities) and enter this text followed by a space character (do not press Return):

    codesign -d --entitlements -
  6. In the Finder, drag the app binary to Terminal.

  7. Press Return.

    For example, the output for an iOS app that is enabled for iCloud key-value storage contains the com.apple.developer.ubiquity-kvstore-identifier entitlement key. The output for a Mac app that is enabled for App Sandbox contains the com.apple.security.app-sandbox entitlement key.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>application-identifier</key>
        <string>G9B5P7QDV2.edu.self.HelloWorld</string>
        <key>com.apple.developer.pass-type-identifiers</key>
        <array>
            <string>G9B5P7QDV2.*</string>
        </array>
        <key>com.apple.developer.ubiquity-container-identifiers</key>
        <array>
            <string>G9B5P7QDV2.edu.self.HelloWorld</string>
        </array>
        <key>com.apple.developer.ubiquity-kvstore-identifier</key>
        <string>G9B5P7QDV2.edu.self.HelloWorld</string>
        <key>get-task-allow</key>
        <true/>
    </dict>
    </plist>

If the app’s entitlements are different than what you have configured, verify that the embedded provisioning profile is correct. First, you need to locate the embedded provisioning profile.

bullet
To locate the embedded provisioning profile in the app binary
  1. In Xcode, select your project in the project navigator.

  2. Click the disclosure triangle next to the project to reveal the contents.

  3. Click the disclosure triangle next to Products to reveal the binary.

  4. Control-click the binary and select “Show in Finder” to go to the Xcode build location in the Finder.

    ../Art/13_locateprofileinbinary_1_2x.png../Art/13_locateprofileinbinary_1_2x.png
  5. In the Finder, Control-click the binary and select Show Package Contents from the menu.

    For iOS apps, a provisioning profile called embedded.mobileprovision appears in the Finder window. For Mac apps, the embedded file is called embedded.provisionprofile.

    ../Art/13_locateprofileinbinary_2_2x.png../Art/13_locateprofileinbinary_2_2x.png
bullet
To verify the entitlements of the embedded provisioning profile
  1. Launch Terminal (located in ~/Applications/Utilities) and enter this text (do not press Return):

    security cms -D -i
  2. In the Finder, drag the provisioning profile in the app binary to Terminal.

    ../Art/13_verifyentitlementsinapp_1_2x.png../Art/13_verifyentitlementsinapp_1_2x.png
  3. Press Return.

    This command outputs a property list in XML format.

  4. Locate the Entitlements key in the output and verify that the application-identifier key has the correct entitlements.

    For example, the following listing shows an iOS app that is enabled for data protection, Passbook, and iCloud. iCloud entitlements begin with the text com.apple.developer.ubiquity.

    <key>Entitlements</key>
        <dict>
            <key>application-identifier</key>
            <string>G9B5P7QDV2.*</string>
            <key>com.apple.developer.default-data-protection</key>
            <string>NSFileProtectionComplete</string>
            <key>com.apple.developer.pass-type-identifiers</key>
            <array>
                <string>G9B5P7QDV2.*</string>
            </array>
            <key>com.apple.developer.ubiquity-container-identifiers</key>
            <array>
                <string>G9B5P7QDV2.*</string>
            </array>
            <key>com.apple.developer.ubiquity-kvstore-identifier</key>
            <string>G9B5P7QDV2.*</string>
            <key>get-task-allow</key>
            <true/>
            <key>inter-app-audio</key>
            <true/>
            <key>keychain-access-groups</key>
            <array>
                <string>G9B5P7QDV2.*</string>
            </array>
        </dict>

See codesign and security for more ways to use these commands.

Recap

In this chapter, you learned how to maintain your certificates and provisioning profiles in a valid state and remove assets that you no longer need. To resolve specific certificate and provisioning profile issues, read “Troubleshooting.”