Tuesday, July 15, 2008
Tuesday, July 15, 2008
debugging iphone apps remotely...
Its not as easy as it could be, but its far from being hard. The first thing you need is your customers device ID (UDID). Once you have that, visit your iPhone developer program portal.
Go into the Device ID area and add any device IDs from your testers. Now go to the Provisioning area and add a Profile. I called my profile “Test Profile”, and attached it to my developer certificate. Select the appropriate App ID, and select all the devices listed that you want to be able to test on. Now submit it.
Feel free to twiddle your thumbs while its in Pending status. .... ... ... ... Ok, its done. Download it. You will get a file that has the extension “.mobileprovision”. Now that you have that file, drag it to the iTunes icon in the dock (iTunes may need to be running for this to work). This installs the provision.
Now head over to Xcode. Open your iPhone app’s project file. Go into the Project Info area, and to the Build tab. Under the Code Signing section, “Code Signing Identity” should be “iPhone Developer: <your name>”, and “Code Signing Provisioning Profile” should be set to “Test Profile”. If you don’t see that in the drop down, then the provision wasn’t installed correctly. Clean and Rebuild your application. To avoid changing this all the time, I duplicated the Release configuration and called it “Test” and build with that.
Now, you can drag your new binary to your iTunes Library Application area and it will sync now sync to your phone.
And for your testers....
You’ll need to send them the app bundle AND the .mobileprovision file mentioned above. They will need to drag the .mobileprovision file to the iTunes icon in the dock (again, it may need to be running already). Once they’ve done that, they must drag the file into their iTunes Library Application area. They should now be able to sync it to their phone.
If any errors are generated on sync, its due to the signing being incorrect in one way or another. The xcode project settings may be wrong, or the provision not installed properly. Once I got iTunes syncing working locally, none of my testers had any issues either.
I couldn’t get Ad-Hoc distribution to work to save my life. I do honestly believe its broken. If its not, then someone needs to be smacked for making it so difficult. That latter part should probably happen anyway. At any rate, the method described above works how I’m guessing Ad-Hoc is supposed to.
Now on to debugging....
Have your users get the iPhone Configuration Utility 1.0 for Mac OS X (here). This will be installed in /Applications/Utilities. When run, one can select the iPhone in question and view/save the device’s console log. You will be debugging via console messages, nice. Its not ideal, but it is better than nothing, so use it until something better comes along.
UPDATE:
When you’re doing the bits above in Xcode, be sure the base SDK is set to “Device - iPhone OS 2.0”