Tuesday, December 29, 2009

Sign and deploy app to iPhone device

A. Create a Certificate Request on disk
- Start application "Keychain Access", use "Certificate Assistant" to request a certificate from Certificate Authority.
Be sure ...
a) The common name match your registered name in iPhone Developer Center
b) Select the checkbox "Let me specify key pair information". If you missed this checkbox, the certificate signed contains only the public key. Use keysize=2048, algorith=RSA.


B. Create iPhone provision file
The most easy way is to login iPhone Developer Program Portal with "agent" privilege. On the Portal home page, launch the "Development Provisioning Assistant", select the saved certificate request from step A. Follow the steps from the Assistant, you also need to have
- Create App ID (e.g. com.mycompany.*)
- Create Device (need to obtain the device ID through Xcode or iTune)
The Assistant will finished with a signed certificate *.cer and provision file profile_name.mobileprovision.

C. Add the certificate to keystore by double clicking the *.cer file.

D. Start XCode, open the "Organizer" window and drag and drop the profile_name.mobileprovision to the "Organizer" window.

E. Open project setting in XCode, check "Code Signing" setting of ...
Code Signing Identity=iPhone Developer :
.. Any iPhone OS Device=iPhone Developer :

F. Open your project's info.plist file, ensure the Bundle identifier has the App ID as prefix.
e.g. com.mycompany.${PRODUCT_NAME:rfc1034identifier)

G. Set the project's Active SDK to iPhone (debug or release), build and deploy by clicking "Build->Build and Go(run)"

Saturday, December 26, 2009

Remove unwanted app which doesn't show delete icon

1. SSH to iPhone with root account, root's password is alpine
e.g. ssh -l root

2. cd to /Applications@ (/Applications@ is a symbolic link to /var/stash/Applications)
delete the the unwanted application directory (says, HelloWorld.app)
e.g. rm -r -f HelloWorld.app

3. The icon on the home screen exists until iPhone restart.

4. Power off and restart iPhone, the unwanted application is gone.