Monday, July 16, 2012

Testing on an Actual Device

Testing on Actual Devices :

Although the iPhone Simulator is a very handy tool that enables you to test your iPhone/i Pad
applications without needing an actual device, nothing beats testing on a real device. This is
especially true when you are ready to roll out your application to the world — you must ensure
that it works correctly on real devices. In addition, if your application requires access to hardware
features on an iPhone, iPod touch, or i Pad, such as the accelerometer, gyroscope, and
G.P.S, you need to test it on a real device — the iPhone Simulator is simply not adequate.
This appendix walks through the steps you need to take to test your applications on a real
device, be it the iPhone, iPod touch, or i Pad. In addition, you will also learn how to prepare
your application for submission to the App Store.

First Step for Apps testing:

The first step toward testing your application on a real device is to sign up for the iPhone
Developer Program at http://developer.apple.com/iphone/program/. Two programs are
available: Standard and Enterprise. For most developers who want to release applications on the
App Store, the Standard program, which costs $99, is sufficient. Check out http://developer
.apple.com/iPhone/program/apply.HTML to learn more about the differences between the
Standard and Enterprise programs.
If you just want to test your application on your actual iPhone/iPod touch, sign up for the
Standard program.

Step Second:(Finding U.D.I.D)

To test your application on your device, you need to perform a series of steps to prepare your
Mac and your device. The following sections walk you through the necessary steps, from
obtaining your certificate to deploying your application onto the device.
First, you need to obtain the 40-character identifier that uniquely identifies your device. This identifier
is known as the U.D.I.D — Unique Device Identifier. Every device sold by Apple has a unique
UDID. To do so, connect your device to your Mac and start Xcode. Choose Window ➪ Organizer
to launch the Organizer application. Figure A-1 shows the Organizer application displaying the
identifier of my iPhone. Copy the identifier and save it somewhere; you will need it later.

 Image sha-1

Step Third:(Logging in to the iPhone Provisioning Portal):

Once you have signed up for the iPhone Developer Program, you can log in to the iPhone Dev
Center website located at http://developer.apple.com/iphone/index.action. Figure A-2 shows
the page displayed after you have logged in to the iPhone Dev Center.
On the right side of the page, you will see a section named iPhone Developer Program. The first item
listed under this section is iPhone Provisioning Portal. This portal contains all the details about preparing
your Mac and devices for testing and deployment. Click the iPhone Provisioning Portal item
to display the window shown in Figure A-3.
The pane on the left contains several links to pages where you can submit various information
required to prepare your Mac and devices for testing. The center pane contains the welcome message
and a Launch Assistant button. If you are using this page for the first time, the Launch Assistant provides
an easy-to-follow series of guided instructions to help you test your applications on your devices.
However, to help you better understand the details of the process, the following sections describe each
step by walking through the various links displayed on the left side of the page.

Image sha-3

Step Fourth:(Generating a Certificate):

The first step toward testing your application on a real device is to obtain a digital certificate from
Apple so that Xcode can use it to code-sign your application. Any applications that are run on your
devices must be code-signed. For testing purposes, you will need a development certificate. Once
you are ready to distribute your application (such as through the App Store), you will then need a
distribution certificate (discussed later in this Appendix).
To request a development certificate from Apple, you need to generate a certificate signing request
(CSR). You can do this using the Keychain Access application located in the Applications/
Utilities/ folder.
In the Keychain Access application, choose Keychain Access ➪ Certificate Assistant and select
Request a Certificate From a Certificate Authority
In the Certificate Assistant window , enter your e‑mail address, check the Saved to
disk option, and click Continue.
You will be asked to save the request to a file. Use the default name suggested and click Save


On the iPhone Provisioning Portal page, click the Certificates item displayed on the left (see
Figure sha-4 ). Four tabs will be displayed on the right side of the page — Development, Distribution,
History, and How To.
In the Development tab, click the Request Certificate button to request a development certificate
from Apple. You will see a detailed list of instructions telling you to generate a certificate request
using the Keychain Access application (see Figure). As you have already performed this step
earlier in this Appendix, click the Choose file button to upload the certificate request file to Apple.
After the file is selected, click Submit to send it to Apple.
Image sha-4

 Image sha-5

As shown in Figure Sha-6, the development certificate will now have a status of Pending Issuance
Image-sha-6


 Simply refresh the page or click the Development tab once more and your development certificate will now be ready (see image-sha-7).

 
Image-sha-7
Click the Download button to download the development certificate. When it is downloaded to your
Mac, double-click the developer_identity.cer file. When prompted, click OK. The certificate will
now be installed in the Keychain Access application, which you can verify


Goto part two

No comments:

Post a Comment