Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (24.65 MB, 900 trang )
Figure 1-14. Selecting the Devices button in Organizer
4. On the left side of Organizer's Devices screen, make sure you've selected your device by clicking on it (Figure 1-15).
Figure 1-15. A device that is not ready for development
5. As you can see, the device has a gray light instead of green. The gray light tells us
that this device is not ready for development. After clicking on the device in the
list, you will then see a button on the right side of the screen saying Use for De18 | Chapter 1: The Basics
www.it-ebooks.info
velopment. Press that button. Once you press this button, you will see a progress
bar appear on the screen and Xcode will start detecting this device.
6. At this stage, Xcode might show a Login screen. This screen asks for your iOS
Developer Portal's credentials. This means that Xcode wants to detect whether the
UDID (Unique Device ID) of your device has already been added to your portal or
not. If it has not been added, Xcode will add it for you. So just go ahead and provide
your iOS Portal credentials to Xcode (see Figure 1-16) and then press the Login
button.
Figure 1-16. Xcode waiting for iOS Portal credentials
7. If everything goes fine and Xcode detects that the iOS version on your device is
something that it can support, it will display the green light next to your device on
the left hand side of Organizer's Devices screen, as shown in Figure 1-17.
1.5 Running iOS Apps on iOS Devices | 19
www.it-ebooks.info
Figure 1-17. An iOS device ready for development
8. Now close Organizer and come back to Xcode. If you now click on the right side
of the Scheme breadcrumb button, you will be able to see your device listed there,
as shown in Figure 1-18.
20 | Chapter 1: The Basics
www.it-ebooks.info
Figure 1-18. An iOS device showing up in the Scheme breadcrumb button in Xcode
If Xcode cannot detect the version of iOS installed on your device, it will display an
amber light next to it. In this case, you either need to get a version of Xcode that does
support your device's iOS version, or you need to change the version of iOS on your
device to match what Xcode supports. Xcode will display the list of iOS versions that
it supports after displaying the amber light next to your device. Xcode, in fact, will give
you the reason why it cannot run iOS apps on your device. If the reason stems from
the version of iOS on your device, the supported versions of iOS will certainly be displayed in Organizer's Devices section.
See Also
XXX
1.6 Packaging iOS Apps For Distribution
Problem
You want to send your iOS app to others so that they can test your app or have a look
at it, before you submit your app to the App Store.
Solution
You need to archive your application.
Discussion
In order to archive an application, you need to follow certain steps:
1.6 Packaging iOS Apps For Distribution | 21
www.it-ebooks.info
1. Make sure that you have fully tested the app on the simulator and you are happy
that your app is stable.
2. Gather the UDIDs (Unique Device Identifiers) of all those devices on which you
want to run your app. You can ask your friends and colleagues for these if the
devices belong to them.
3. Add these UDIDs to your iOS Portal.
4. Create an Ad Hoc Distribution provision profile. Provision profiles are a mix of
binary and XML content that allow an application to be executed on devices that
have been linked to that provision profile.
5. After you have your provision profiles (a file that end with .mobileprovision extension), tell Xcode to use that provision profile for release purposes, as we will soon
see.
6. Within Xcode, select the Product menu and then choose Archive. Xcode will now
archive your application and, when that is done, display Organizer to you. Here
you can export your archived application as a file (with the .ipa extension) that
your testers/colleagues/friends can drag and drop into their iTunes or iPhone Configuration Utility to install your app on their iOS devices.
To distribute your iOS app to testers/colleagues and friends, you have to create an Ad
Hoc provision profile. Follow these steps to create your Ad Hoc provision profile:
1. Log into the iOS Dev Center.
2. Select iOS Provision Portal from the right side of the screen.
3. If you have not created a Distribution certificate yet, follow these steps:
a. On the left hand side of iOS Provision Profile, select Certificates.
b. On the right hand side, select the Distribution tab on the top of the screen.
c. Follow the instructions on the screen, which will ask you to use Keychain
Access to create a new certificate on your computer and then upload that certificate to the portal. After this you will have your Distribution certificate.
d. Click on the Download button to the right side of your Distribution certificate
to download it. After you've downloaded it on your computer, double click
on it to install it in your Keychain Access.
4. Now move to the Devices item on the left hand side of the screen.
5. Select the Add Devices button on the right side of the screen.
6. Enter the device name and the device UDID in the boxes provided. If entering more
than one device, press the + button after every device to make room for a new
device. You can add a maximum of 100 devices to each provision portal (except
for Enterprise portals, which we won't cover in this book, as they are given only to
big organizations).
22 | Chapter 1: The Basics
www.it-ebooks.info