How do I build an iPhone application for iOS?
This lesson will show you how to use LiveCode to create, test and deploy an iPhone application.
Before you can build iPhone applications, you'll need to have the iPhone SDK installed on your machine. You can register as an iPhone developer and get the SDK here: http://developer.apple.com/iphone. For more information on how to get started with iPhone development see this lesson: How Do I Become An iPhone Developer.
Create or open the App you want to build for iOS
If you are creating an App from scratch you'll need to create a new stack of the right size:
iPhone 3G and older: 480px by 320px
iPhone 4: 960px by 640px.
iPad: 1024px by 768px
For this example we've used the sheep herder application we made to demonstrate LiveCode in action. You can download the source here:
And watch us make it here:
Open the standalone builder and configure deployment options
Open the standalone application setting from the File menu and go to the iOS tab. Here you'll be able to configure the Apps basic settings and also set a wide range of other more fine grained options (Plist options for those more seasoned developers).
You must select "Build for iOS" (1) in order to enable the Simulator and building iOS standalones.
You must also select the device profile(2) you created when you registered with Apple.
Testing with the simulator
When you install the iPhone SDK on your machine, you'll get an iPhone simulator application, which allows you to debug your iPhone apps easier than using a real device. Once you have selected the build for iOS option in the standalone builder, you'll see the "simulate" button has now become active. Clicking this will launch the simulator*.
* Mac OS users only who have Xcode tools installed.
** Screenshot shows the simulator in retina display mode.
Creating the deployment bundle
Once you have registered appropriately as an iPhone developer and setup your certificate and obtained a provisioning profile, you can deploy your application onto a real iPhone, iPad or iPod touch. To do this, simply choose your provisioning profile from the drop-down list in the standalone application setting screen, and then select "Save as Standalone Application..." from the file menu.
For more information on registering as an iPhone developer see the lesson here: How Do I Become An iPhone Developer.
Putting the App onto your device
1) Open Xcode
2) In the 'Window' menu select 3) "Organizer"
4) Drag your App bundle into the 'Applications' pane
You app should now be on your device!