아이폰으로 개발 테스트 하기
Obtaining your iOS Development Certificate
In the ‘Certificates’ section of the iOS Provisioning Portal, you can request individual iOS Development Certificates. All iOS applications must be signed by a valid certificate before they can be run on an Apple device. In order to sign applications for testing purposes, Team Members need an iOS Development Certificate.
A digital identity is an electronic means of identification consisting of a secret "private key" and a shared "public key". This private key allows Xcode to sign your iOS application binary.
The digital certificates you request and download are electronic documents that associate your digital identity with other information, including your name, email address, or business. An iOS Development Certificate is restricted to application development only and is valid for a limited amount of time. The Apple Certification Authority can also invalidate ("revoke") a certificate before it expires.
Generating a Certificate Signing Request
Submitting a Certificate Signing Request for Approval
- After creating a CSR, log in to the iOS Provisioning Portal and navigate to ‘Certificates’ > ‘Development’ and click ‘Add Certificate’.
- Click the ‘Choose file’ button, select your CSR and click ‘Submit’. If the Key Size was not set to 2048 bits during the CSR creation process, the Portal will reject the CSR.
- Upon submission, Team Admins will be notified via email of the certificate request.
- Once your CSR is approved or rejected by a Team Admin, you will be notified via email of the change in your certificate status.
Approving Certificate Signing Requests
Team Agents and Team Admins have the authority and responsibility to approve or reject all iOS Development Certificate requests. In order to approve/reject Team Members’ requests, all Team Admins should first submit their own CSR for approval.
- After submitting a CSR for approval, Team Admins will be directed to the ‘Development’ tab of the ‘Certificates’ section. Here, CSRs can be approved or rejected by clicking the corresponding action next to each request.
- Once a CSR is approved or rejected, the requesting Team Member is notified via email of the change in their certificate status. Each iOS Development Certificate is available to both the Team Member who submitted the CSR for approval and to the Team Admin(s).
Downloading and Installing Development Certificates
- In the ‘Certificates’ > ’Distribution’ section of the Portal, control-click the WWDR Intermediate Certificate link and select “Saved Linked File to Downloads” to initiate download of the certificate.
- On your local machine, double-click the WWDR Intermediate certificate to launch Keychain Access and install.
- Upon CSR approval, Team Members and Team Admins can download their certificates via the ‘Certificates’ section of the Provisioning Portal. Click ‘Download’ next to the certificate name to download your iOS Development Certificate to your local machine.
- On your local machine, double-click the downloaded .cer file to launch Keychain Access and install your certificate.
- Team Members can only download their own iOS Development Certificates. Team Admins have the authority to download the public certificates of all of their Team Members. Apple never receives the private key for a CSR. The private keys are not available to anyone except the original key pair creator and are stored in the system keychain of that Team Member.
Saving your Private Key and Transferring to other Systems
It is critical that you save your private key somewhere safe in the event that you need to develop on multiple computers or decide to reinstall your system OS. Without your private key, you will be unable to sign binaries in Xcode and test your application on any Apple device. When a CSR is generated, the Keychain Access application creates a private key on your login keychain. This private key is tied to your user account and cannot be reproduced if lost due to an OS reinstall. If you plan to do development and testing on multiple systems, you will need to import your private key onto all of the systems you’ll be doing work on.
- To export your private key and certificate for safe-keeping and for enabling development on multiple systems, open up the Keychain Access Application and select the ‘Keys’ category.
- Control-Click on the private key associated with your iOS Development Certificate and click ‘Export Items’ in the menu. The private key is identified by the iOS Developer: <First Name> <Last Name> public certificate that is paired with it.
- Save your key in the Personal Information Exchange (.p12) file format.
- You will be prompted to create a password which is used when you attempt to import this key on another computer.
- You can now transfer this .p12 file between systems. Double-click on the .p12 to install it on a system. You will be prompted for the password you entered in Step 4.
https://developer.apple.com/ios/manage/certificates/team/howto.action
http://blog.pointbre.com/132
Assigning Apple Devices to your Team
The Devices section of the iOS Provisioning Portal allows you to enter the Apple devices that you will be using for your iOS development. In order to debug your iOS application on an Apple device, a Team Agent or Team Admin must first enter the Unique Device Identifier (UDID) for each iPhone and iPod touch into the Provisioning Portal. The UDID is a 40 character string that is tied to a single device, similar to a serial number. These UDIDs are included in the provisioning profiles created later. You can input up to 100 devices for your development team.
Locating a Unique Device ID
To find out your device’s UDID, simply connect your device to your Mac and open Xcode. In Xcode, navigate to the ‘Window’ drop down menu and select ‘Organizer’. The 40 hex character string in the Identifier field is your device’s UDID. Team Members should send this string to their Team Admins for input into the Provisioning Portal.
Locating a Unique Device ID with iTunes 7.7 or later
Alternatively, you can also find out your device’s UDID using iTunes 7.7. or later. To do this, connect your device to your Mac and launch iTunes. In iTunes, select your device in the ‘Devices’ section and navigate to the Summary tab. Click on the Serial Number label to reveal the Identifier field and the 40 character UDID. Press Command+C to copy the UDID to your clipboard.
Adding Individual Devices
Upon receiving a UDID, Team Admins should navigate to the ‘Devices’ section of the Provisioning Portal and click ‘Add Device’. Admins will enter a Device Name as well as the UDID and click ‘Submit’.
Bulk Upload of Devices
Alternatively, Team Admins can enter multiple UDIDs at once by uploading a .deviceids file generated by the iOS Configuration Utility or uploading a tab delimited, .txt file.
If you wish to upload a tab-delimited .txt file containing your devices, follow the below steps but choose your .txt file instead of a .deviceid file. Your file should contain one Device ID and the Device Name in each row. (Note: The first row in your .txt file will be ignored as it should contain headers only).
Within the iOS Configuration Utility, select the devices you wish to upload and click the Export button. This will create a .deviceids file.
Upon generating a deviceid file, Team Admins should navigate to the ‘Devices’ section of the Provisioning Portal and click ‘Choose File’. Select your deviceid file and click ‘Submit’.
Removing Devices from your Development Team
To remove a device from your development team, navigate to the ‘Devices’ area of the Provisioning Portal and click the ‘Remove’ link to the right of the desired device. Removing a device from your development team will invalidate all provisioning profiles containing that device. Affected provisioning profiles will need to be modified in order to be downloaded again.
Editing Devices on your Development Team
To edit a device on your development team, navigate to the ‘Devices’ area of the Provisioning Portal and click the ‘Modify’ link to the right of the desired device. You may change the device name without affecting any existing provisioning profile(s) associated with the device. However, if you change the device ID, you will invalidate any existing provisioning profile(s) associated with the device. Affected provisioning profiles will need to be modified in order be downloaded again.
Installing iOS
Creating your App ID
An App ID is a unique identifier that iOS uses to allows your application to connect to the Apple Push Notification service, share keychain data between applications, and communicate with external hardware accessories you wish to pair your iOS application with. In order to install your application on an iOS based device, you will need to create an App ID.
Each App ID consists of a universally unique 10 character “Bundle Seed ID” prefix generated by Apple and a “Bundle Identifier” suffix that is entered by a Team Admin in the Provisioning Portal. The recommended practice is to use a reverse-domain name style string for the “Bundle Identifier” portion of the App ID. An example App ID would be: 8E549T7128.com.apple.AddressBook.
If you are creating a suite of applications that will share the same Keychain access (e.g. sharing passwords between applications) or have no Keychain Access requirements, you can create a single App ID for your entire application suite utilizing a trailing asterisk as a wild-card character. The wild-card character must be the last character in the App ID string. Example App IDs for this situation could be: R2T24EVAEE.com.domainname.* or R2T24EVAEE.*
In these wild-card situations, you’ll simply replace the asterisk with whatever string you wish in the CF Bundle Identifier field in Xcode.
Generating an App ID
- Team Agents or Team Admins should navigate to the ‘App ID’ section of the Provisioning Portal.
- Click ‘Add ID’.
- Enter a common name for your App ID. This is a name for easy reference and identification within the Provisioning Portal.
- Enter a Bundle Identifier in the free-form text field. The recommended usage is a reverse-domain name style string, e.g., com.domainname.applicationname. For a suite of applications sharing the same Keychain access, you should use a wild-card character in the Bundle Identifier (e.g. com.domainname.* or *). This Bundle Identifier will need to match whatever CF Bundle Identifier you use for your application in Xcode.
- Click ‘Submit’. At this time, the 10 character Bundle Seed ID is generated and concatenated with the Bundle Identifier you entered. This resulting string is your App ID. Note: The Bundle Seed ID does not need to be entered into Xcode.
- Generate a new App ID for each set of applications with shared Keychain Access needs. If you are creating a suite of applications that will share the same Keychain access (e.g. sharing passwords between applications) or have a set of applications with no Keychain Access requirements, create a single App ID for all applications utilizing a trailing asterisk as a wild-card character.
Registering an App ID for Apple Push Notification service
- In the App ID section of the Provisioning Portal, locate the App ID you wish to use with the Apple Push Notification service. Only App IDs with a specific bundle ID can be used with the APNs. You cannot use a “wild-card” application ID. You must see “Available” under the Apple Push Notification service column to register this App ID and configure a certificate for this App ID.
- Click the 'Configure' link next to your desired App ID.
- In the Configure App ID page, check the Enable Push Notification Services box and click the Configure button. Clicking this button launches the APNs Assistant, which guides you through the next series of steps that create your App ID specific Client SSL certificate.
- Download the Client SSL certificate file to your download location. Navigate to that location and double-click the certificate file (which has an extension of cer) to install it in your keychain.
- When you are finished, click Done in the APNS Assistant.
- Double-clicking the file launches Keychain Access. Make sure you install the certificate in your login keychain on the computer you are using for provider development. The APNs SSL certificate should be installed on your notification server.
- When you finish these steps you are returned to the Configure App ID page of the iOS Dev Center portal. The certificate should be badged with a green circle and the label “Enabled”.
- To complete the APNs set-up process, you will need to create a new provisioning profile containing your APNs-enabled App ID.
Registering an App ID for In App Purchases and Game Center
NOTE: You must create a new In App Purchase Test User account in iTunes Connect in order to utilize the In App Purchase Sandbox for testing. Any existing iTunes or iOS Developer accounts cannot be used for sandbox testing. Refer to the iTunes Connect Developer Guide for instructions on creating these test accounts. In order to utilize the Game Center Sandbox for testing, you must also create a new Game Center Test User account in the Game Center application on your device.
- All explicit App IDs are automatically enabled for In App Purchase and Game Center. Wildcard App IDs and duplicates of existing explicit App IDs are ineligible for In App Purchase and Game Center.
- Go to the Manage In App Purchase module in iTunes Connect to set up your In App Purchase.
Creating and Downloading Development Provisioning Profiles
A Provisioning Profile is a collection of digital entities that uniquely ties developers and devices to an authorized iOS Development Team and enables a device to be used for testing. A Development Provisioning Profile must be installed on each device on which you wish to run your application code. Each Development Provisioning Profile will contain a set of iOS Development Certificates, Unique Device Identifiers and an App ID.
Devices specified within the provisioning profile can be used for testing only by those individuals whose iOS Development Certificates are included in the profile. A single device can contain multiple provisioning profiles.
Creating a Development Provisioning Profile
- In the ‘Provisioning’ section of the Portal, Team Admins should click 'Add' on the Development tab.
- Enter a name for the provisioning profile.
- Specify which devices will be associated with the provisioning profile. You must specify a device in order for that device to utilize the provisioning profile. If a device's UDID is not included in the provisioning profile the profile and your application cannot be installed on that device.
- Specify which iOS Development Certificates will be associated with the provisioning profile. You must specify an iOS Development Certificate in order for the application code signed with that same certificate to run on the device.
- Specify a single App ID for the Development Provisioning Profile. Each Development Provisioning Profile can specify only ONE App ID, therefore, if you have applications requiring different Keychain access, you will need to create a separate Development Provisioning Profile for each of those applications. If you are installing a suite of applications with the same required Keychain access or have a set of applications not requiring access to the Keychain, use an App ID containing the wild-card asterisk character to build all of your applications.
- Click ‘Submit’ to generate your Development Provisioning Profile.
Installing a Development Provisioning Profile
All Team Agents, Admins and Members can download a Development Provisioning Profile from the ‘Provisioning’ section of the Portal after it has been created. Only those developers whose Apple device IDs and iOS Development Certificates are included in the provisioning profile will be able to install and test their application on their device.
- In the ‘Provisioning’ section of the Provisioning Portal, click the download button next to the desired provisioning profile.
- Drag the downloaded file onto the Xcode application icon in the dock or into the ‘Organizer’ window within Xcode. This will automatically copy the .mobileprovision file to the proper directory. Alternatively, you can drag the .mobileprovision file onto the iTunes icon in the dock or copy the file to ‘~/Library/MobileDevice/Provisioning Profiles’. If the directory does not exist you will need to create it. Click on the ‘+’ button in the Provisioning section of the Organizer window to install your .mobileprovision file.
Building and Installing your Development Application
Now that you have an approved iOS Development Certificate, an assigned Apple device and a properly installed Development Provisioning Profile, Xcode can now build your application and install it on your development device. If you have a single iOS Development Certificate and iOS Development Provisioning Profile, you don’t need to change any settings in Xcode to start running your applications. To compile and install your code:
- Launch Xcode and open your project.
- In the Project Window, select ‘Device - iPhone OS’ from the ‘Device | Debug’ drop down menu in the upper-left hand corner.
- Highlight the project Target and select the ‘Info’ icon from the top menu bar.
- In the Target Info window, navigate to the ‘Build’ pane. Click the ‘Any iOS Device’ pop-up menu below the ‘Code Signing Identity’ field and select the iOS Development Certificate/Provisioning Profile pair you wish to sign and install your code with. Your iOS Development certificate will be in bold with the Provisioning Profile associated with it in grey above. In the example below, ‘iOS Developer: Team Leader’ is the Development Certificate and ‘My First Development Provisioning Profile’ is the .mobileprovision file paired with it.
Note: If the private key for your iOS Development certificate is missing, or if your iOS Development certificate is not included in a provisioning profile, you will be unable to select the iOS Development Certificate/Provisioning Profile pair and you will see the following. Re-installing the private key or downloading a provisioning profile with your iOS Development certificate included in it will correct this.
- In the Properties Pane of the Target Info window, enter the Bundle Identifier portion of your App ID. If you have used an explicit App ID you must enter the Bundle Identifier portion of the App ID in the Identifier field. For example enter com.domainname.applicationname if your App ID is A1B2C3D4E5.com.domainname.applicationname. If you have used a wildcard asterisk character in your App ID, replace the asterisk with whatever string you choose.
Here are example App IDs and what should be input into the Identifier field in Xcode.
- Example App ID: A1B2C3D4E5.com.domainname.applicationname
Identifier to enter in Xcode: com.domainname.applicationname
- Example App ID: A1B2C3D4E5.com.domainname.*
Identifier to enter in Xcode: com.domainname.<name_of_application_or_suite>
- Example App ID: A1B2C3D4E5.*
Identifier to enter in Xcode: <full_reverse_dns_university_and_application_or_suite_name>
- Click ‘Build and Go’ to install the application on your Apple device.
Distribution
The distribution area of the iOS Provisioning Portal is where you will prepare and learn how to submit your iPhone and/or iPod touch application for delivery via in-house or Ad Hoc distribution. Only Team Agents are authorized to prepare and submit applications for distribution.
For information about distributing your application on the App Store, please see the App Store tab.
Obtaining your iOS Distribution Certificate
In order to distribute your iOS application, the Team Agent is required by Apple to create an iOS Distribution Certificate. Only the Team Agent for your team will be able to create this certificate and only this certificate will enable application submission.
Generating a Certificate Signing Request
Submitting a Certificate Signing Request for Approval
Downloading and Installing iOS Distribution Certificates
Saving your Private Key and Transferring to Other Systems
Create and download your iOS Distribution Provisioning Profile for App Store Distribution
To successfully build your application with Xcode for distribution via the App Store, you first need to create and download an App Store Distribution Provisioning Profile. These are different than the Development Provisioning Profiles that were used earlier in that Apple will only accept applications if they are built with an App Store Distribution Provisioning Profile.
Note: App Store provisioning profiles do not allow for a distribution built application to be installed on an Apple device. To install your distribution ready application on a device, you must create an Ad Hoc provisioning profile.
- Team Agents should navigate to the Provisioning section of the Provisioning Portal and select the Distribution tab.
- Select the App Store radio button.
- Enter the name for your Distribution Provisioning Profile.
- Confirm your iOS Distribution Certificate has been created and is displayed.
- Select your wild-card App ID to build all of your applications with your single Distribution Provisioning Profile.
- Click ‘Submit’.
- Click on the name of the Distribution Provisioning Profile to download the .mobileprovision file.
- Drag the .mobileprovision onto the Xcode or iTunes icon in the dock to install.
Creating and Downloading a Distribution Provisioning Profile for Ad Hoc Distribution
To successfully build your application in Xcode for Ad Hoc distribution, you will need to create and download an Ad Hoc Distribution Provisioning Profile.
- Team Agents should navigate to the ‘Provisioning’ section of the Provisioning Portal.
- Select the ‘Ad Hoc’ radio button.
- Enter the name for your Ad Hoc Distribution Provisioning Profile.
- Confirm your iOS Distribution Certificate has been created and is displayed.
- Select the App ID for the application (or suite of applications) you wish to distribute.
- Select up to 100 UDIDs which you wish to run your application on.
- Click ‘Submit’.
- Click on the name of the Distribution Provisioning Profile to download the .mobileprovision file.
- Drag the .mobileprovision onto the Xcode or iTunes icon in the dock to install.
Building your Application with Xcode for Distribution
- Launch Xcode and open your project.
- If you have not already done so, drag the Distribution Provisioning Profile downloaded from the Provisioning Portal onto the Xcode or iTunes icon in the dock (or, drag into ‘~/Library/MobileDevice/Provisioning Profiles’ directory.)
- Open the Xcode project and Duplicate the “Release” configuration in the Configurations pane of the project's Info panel. Rename this new configuration “Distribution”.
- In the Target Info window, select the ‘Build’ tab and set the ‘Configuration’ to ‘Distribution’
- In the Target Info window, navigate to the ‘Build’ pane. Click the ‘Any iOS Device’ pop-up menu below the ‘Code Signing Identity’ field and select the iOS Distribution Certificate/Provisioning Profile pair you wish to sign and install your code with. Your iOS Distribution certificate will be in bold with the Provisioning Profile associated with it in grey above. In the example below, ‘iOS Distribution : Example Corp, Inc.’ is the Distribution Certificate and ‘My App Store Distribution Provisioning Profile’ is the .mobileprovision file paired with it.
Note: If the private key for your iOS Distribution certificate is missing, you will be unable to select the iOS Distribution Certificate/Provisioning Profile pair and you will see the following. Importing the private key for your iOS Distribution certificate will correct this.
- In the Properties Pane of the Target Info window, enter the Bundle Identifier portion of your App ID. If you have used an explicit App ID you must enter the Bundle Identifier portion of the App ID in the Identifier field. For example enter com.domainname.applicationname if your App ID is A1B2C3D4E5.com.domainname.applicationname. If you have used a wildcard asterisk character in your App ID, replace the asterisk with whatever string you choose.
Here are example App IDs and what should be input into the Identifier field in Xcode.
- Example App ID: A1B2C3D4E5.com.domainname.applicationname
Identifier to enter in Xcode: com.domainname.applicationname
- Example App ID: A1B2C3D4E5.com.domainname.*
Identifier to enter in Xcode: com.domainname.<name_of_application_or_suite>
- Example App ID: A1B2C3D4E5.*
Identifier to enter in Xcode: <full_reverse_dns_company_and_application_or_suite_name>
- In the project window, select the Distribution Active Configuration from the overview popup and set the Active SDK to the desired Device.
For App Store Distribution, skip to Step 12. For Ad Hoc Distribution, complete the following:
- In the File Menu, select New File -> iPhone OS -> Code Signing -> Entitlements.
- Name the file “Entitlements.plist" and click ‘Finish’. This creates a copy of the default entitlements file within the project.
- Select the new Entitlments.plist file and uncheck the “get-task-allow” property. Save the Entitlements.plist file.
- Select the Target and open the Build settings inspector. In the ‘Code Signing Entitlements’ build setting, type in the filename of the new Entitlements.plist file including the extension. There is no need to specify a path unless you have put the Entitlements.plist file somewhere other than the top level of the project.
- Click ‘Build’. (Note: Your binary must contain a flattened, square-image icon that is 57x57 pixels. This icon is displayed on the iPhone or iPod touch home screen.)
- Highlight the app located within the "Products" sub-folder and select ‘Reveal in Finder’ from the Action popup.
- Use the compress option in Finder to create a .zip file containing your application. Be sure to compress only the .app file only and not the entire build folder.
Verifying a Successful Distribution Build
To confirm your build was successful, check for the following:
- Open the Build Log detail view and confirm the presence of the "embedded.mobileprovision” file. This will take you to the line in the build log that shows the provisioning profile was successfully called. Ensure that the embedded.mobileproviion is located in the proper “Distribution” build directory and is not located in a “Debug” or “Release” build directory. Also, confirm that the destination path (at the very end of the build message) is the app you are building.
- Search for the term “CodeSign” in the Build Log detail view - this will take you to the line in the build log that confirms your application was signed by your iOS Certificate.
If your project is lacking any of the above files or pointing to the wrong directory, do the following:
- Select the Target and open the Build Settings Inspector. Confirm you are in the Distribution Configuration.
- Delete the Code Signing Identity: iOS Distribution : COMPANYNAME
- In the Xcode Build Menu, select Clean all Targets.
- Delete any existing build directories in your Xcode project using Finder.
- Re-launch Xcode and open your Project.
- Re-enter the code-signing identity iOS Distribution : COMPANYNAME in the Target Build Settings Inspector.
- Rebuild your Project.
Updating your Application
The App Store uses three pieces of information in your application to identify a submission as an update to an existing application. *When you are submitting an update of your application to iTunes Connect for App Store distribution, make sure to:
- Use the same Distribution Provisioning Profile to build each new version of your application
- Increment the CFBundleVersion and CFBundleShortVersionString values in your project Info.plist file. Note: Version numbers must be period-delimited sequences of positive integers (1.0 to 1.1, or 2.2.1 to 2.2.2).