开发者

Test App on Real iPhone [duplicate]

开发者 https://www.devze.com 2023-03-13 05:25 出处:网络
This question already has answers here: Cl开发者_运维百科osed 11 years ago. Possible Duplicate: Deploy an iphone app from xcode to iphone
This question already has answers here: Cl开发者_运维百科osed 11 years ago.

Possible Duplicate:

Deploy an iphone app from xcode to iphone

Hi I have tested my app using the iOS simulator. How can I test it on my own iphone? I am an Apple developer member.


The first thing you need is a development certificate. Visit the iOS provisioning portal and follow the steps here: http://developer.apple.com/ios/manage/certificates/team/howto.action:

Test App on Real iPhone [duplicate]

Once that is done, you can do everything else from Xcode. Using Xcode 4:

  1. Connect your device via USB.
  2. Open the Xcode organizer (Window->Organizer)
  3. Select "Provisioning Profiles"

    Test App on Real iPhone [duplicate]

  4. Check the "Automatic Device Provisioning" checkbox and click "Refresh"

    Test App on Real iPhone [duplicate]

    You will be prompted to enter your developer account username and password. Do this.

    This step will automatically create and download a wildcard (*) provisioning profile that you can use for testing any application on your device.

  5. After a few seconds you should see this new profile appear in the list with the name "Team Provisioning Profile: *"

    Test App on Real iPhone [duplicate]

  6. Restart Xcode just to be safe. Sometimes it can get confused.

  7. Open a project and select your device from the main schemes dropdown box:

    Test App on Real iPhone [duplicate]

  8. Build and run.

    If that doesn't work straight away, make sure your target has the correct code signing options. Find your target's build settings and for the Debug configuration choose "iPhone Developer" under the "Automatic Profile Selector" group in the dropdown:

    Test App on Real iPhone [duplicate]

    This should be selected by default.

Good luck!


You need to learn about creating Adhoc Distributions for iOS devices for detailed reference. I am however putting all of it here in the answer:

Creating iPhone Ad Hoc Distribution Builds

1. Adding Beta Tester Devices

Apple allows an Ad Hoc build to be distributed to up to 100 devices which they enforce by making you add the devices to the distribution provisioning certificate. This means that you need to retrieve the UDID for all of the test devices, add them to the provisioning profile using the iOS Provisioning Portal and then download and install the profile.

2. Finding the UDID

To get started you need to ask your beta testers to supply the Unique Device ID (UDID) for their devices. To find UDIDs they can follow the steps on:

  • whatsmyudid.com

3. Registering the Device

Once you have the UDID you need to add it to your account in the iOS Provisioning Portal in the same way you would for a development device. You do this in the Devices section of the portal and can either use the ‘Add Device’ button to manually add a single device or use the Upload Devices button to bulk upload multiple UDIDs from a text file.

Note: If you want to bulk upload multiple devices the format of the text file needs to be as follows with the two columns separated with tabs:

Device ID                                Device Name
1234567890123456789012345678901234567890 Test_iPad

The contents of the first line are not important but you need to put something as the first line is ignored when you upload.

Also be aware that you can only register up to 100 devices each year. You can delete devices any time you want but once added they still count towards your annual allocation. (So if you add 100 devices and then delete 50 of them you still have to wait until the next year before you can add any more).

4. Creating the Distribution Provisioning Profile

Assuming you already have a distribution certificate the process to create an Ad Hoc provisioning profile is quick and easy. In the Distribution tab of the Provisioning section use the New Profile button.

The only difference between an Ad Hoc profile and a normal App Store profile is the Distribution Method.

Ensure you select the Ad Hoc method and then enter a profile name, the App ID and finally ensure you select all of the devices you want the Ad Hoc build to run on. Once you have finished submitting the profile you should download it and save it somewhere safe as you will need to send it to each of the beta testers. The file should have an extension of .mobileprovision. You should also drag the file onto your Xcode icon to install it, you can use the Xcode organiser to verify that it installed ok. You should see the profile in the Provisioning Profiles section.

5. Building for Ad Hoc Distribution

With the provisioning profiles configured correctly the next step is to prepare the project in Xcode for an Ad Hoc build. It might be useful to create a configuration just for Ad Hoc builds so that you do not have to worry about the details each time. The easiest way to do that is to copy an existing configuration, if you already have a Distribution configuration that is probably a good starting point otherwise you can start from the default “Release” configuration.

With the project open in Xcode, right-click on the target and select “Get Info” to bring up the Info dialog window and select the Build tab and then in the Configuration drop down menu select “Edit Configurations…”

Select an existing configuration (e.g. Release or Distribution) and then at the bottom of the window use the Duplicate button to create a copy of the configuration and name it “AdHoc”.

In the Target Info window ensure this new AdHoc configuration is selected and then adjust the following settings in the Build tab. In the Code Signing section, look for the “Any iOS” setting under Code Signing Identity and make sure it is set to iPhone Distribution and matches the Ad Hoc provisioning profile we installed previously.

6. Entitlements

There is one additional step if your project includes an Entitlements.plist file (perhaps because you needed to enable keychain data sharing). For an Ad Hoc distribution you need to ensure that the get-task-allow flag is not set in the plist file. One way to handle this is to add a second file (Entitlements-adhoc.plist) just for the Ad Hoc build which is identical apart from the get-task-allow flag:

To ensure this new Entitlements file is used you need to modify the Code Signing Entitlements setting in the AdHoc configuration to reference the new file.

7. Build and Archive

With the AdHoc build settings active use the Build and Archive command to create the distribution build. Assuming the build was successful you should find it in the Xcode Organizer in the Archived Applications section. You can add a name and comment to the organizer for future reference at this point.

8. Sharing the Application

The easiest way to send the application files to a beta tester is to use the Xcode organizer to create an ipa file. To do that select the AdHoc build in the Archived Applications section and use the Share button and then select Save to Disk. Xcode will create a signed application file and save it to disk with a name of your choosing. Name the file something useful like appName-x.y.z.ipa where x.y.z is the version number.

You can then send this .ipa file together with the .mobileprovision file to your beta tester with instructions to drag onto their iTunes library to install it on the test device.

For sharing and application versioned release management you can also use testflightapp


You should add your device UUID to your iOS provisioning portal. Create an App id. Create a mobile provisioning profile by selecting your device and App Id. Download and install that profile to your device. The build and run your app on the device. Please let me know if you need further clarification.

0

精彩评论

暂无评论...
验证码 换一张
取 消