How do I build an iOS application?
This lesson will show you how to use LiveCode to create, test and deploy an iPhone or iPad application.
Before you can build iOS applications, you'll need to have Xcode installed on your machine. This is currently available from the Mac App Store or you can register as an iPhone developer and get older SDKs 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 iOS Developer.
Create or open the App you want to build for iOS
If you are creating an App from scratch, you can choose one of the premade stack sizes in the File Menu to suit your iPhone or iPad screen. You can also easily resize your stack to fit whatever device you are creating your project for.
For this example we've used the sheep herder application we made to demonstrate LiveCode in action. You can download the source from this url:
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. (if deploying to a test device). Your standalone settings may look like the first screenshot in older versions, or the second if you are using a recent version of LiveCode.
Testing with the simulator
When you install the Xcode on your machine, you'll get an iOS simulator application, which allows you to debug your iOS apps more easily than using a real device. Once you have selected the build for iOS option in the standalone builder and selected a simulator from the development menu,you'll see the "Test" button has now become active. Clicking this will launch the simulator*.
NB Xcode must be linked to your version of LiveCode via LiveCodes Mobile Support Preferences. This option is available from "LiveCode"--->"Preferences"---->"Mobile Support"
An example video of this process can be found here-
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(like discussed above), and then select "Save as Standalone Application..." from the file menu.
Note: Your Internal App ID, set in the standalone builder, is what iOS uses to identify the app. If there is an app on the device with the same identifier as the app you are adding it will assume it is an update and overwrite the app on the device. To avoid this you need to make this ID different for each of your apps.
For more information on registering as an iPhone developer see the lesson here: How Do I Become An iOS Developer.
Note: if you receive a "linking for armv7 failed with g++: failed to exec /Applications/Xcode.app/Contents/Developer/usr/bin/clang++; No such file or directory" error message when building this generally means the required command line tools have not been automatically set in Xcode. You can resolve this by opening Xcodes preferences, navigating to "Locations" and select the available command line tools from the drop down menu. If none are present, you may need to download them from the "Downloads" tab.
Putting the App onto your device using Xcode
1) Open Xcode
2) In the 'Window' menu select 3) "Devices"
4) Select your connected iOS device
5) Drag standalone app to "Installed Apps" section of device window
Your app should now be on your device!
Putting the app onto your device using Apple Configurator 2
Another option is to use Apple Configurator 2 as described here.
This method can be used with Apps that have been shared with testers etc and by users who do not have Xcode installed.
When sharing a built app it can only be installed on devices that are registered under your Development Provisioning Profile.
I am an old-style-dbase-III-style developer and I am testing the free trial live code. I love it. I would like to know if when I finish my project and build the stand-alone-app (and buy the apple developer license and live code license), will I have to learn x-code and modify the app in order to send the app to apple so it can be approved and sold in the app store?
No - no xcode and no conversion necessary to get the app into the app store.
once you have implemented your application and it works on the iOS simulator, you should be able to submit it to the app store. As you point out correctly, you will first have to follow the appropriate certification and approval process. You should not have to write any x-code.
You can check out the following lessons for more information: "How do I Create a Distribution Profile for iOS?", "How do I set up an App for Submission to iTunes Connect?" and "How do I Submit an iOS App to the App Store?".
I can't seem to install more than one application on my phone.
How do I go about adding more applications that I have created in LiveCode to my phone through xCode?
Whenever I try to add a new app, it forces me to overwrite the one I already have on there.
In the iOS Standalone Application Settings you can set the Internal App ID, by default this is com.yourcompany.yourapp.
This is what iOS uses to identify the app, if there is an app on the device with the same identifier as the app you are adding it will assume it is an update and overwrite the app on the device. You just need to make this ID different for each of your apps.
I hope that helps.
Do I have to join the iOS Developer program (as a paid member) to even get my LiveCode app to run in the iOS Simulator?
There is a free Apple Developer Program you can join which allows you to run your apps in the simulator but not deploy them to a real device or put them in the App Store. For this you do need to join the paid for program.
You can register at
I hope that helps.
Thank you for LiveCode, I really like it.
At the moment I try to submit my App for the App store.
But first I try to save it as a stand alone, and there the problem starts. I have to check the Application Profile, but there is only I can select.
In your example I see under "Open the standalone builder and configure deployment options" you check 'RevMobile iPhone PreAlpha'.
In other words, how can I set the profile proper?
waiting for your help,
kind regards, Herman
I am assuming you are trying to select "RevMobile iPhone PreAlpha" from the "Profile" drop down menu.
"RevMobile iPhone PreAlpha" is a provisioning profile we set up to test the application. You have to set up a provisioning profile for application distribution. Once you have done that, you should have a provisioning profile for App Store distribution.
I have included references to the following lessons that should help you further:
Hello Hanson and Karthik
Thank you for your emails.
I try to make an App using LiveCode for the iPhone
I try to create a distribution profile now.
It takes a lot of time. The lessons are very helpful, Hanson, I suppose I have to make an App ID, too?
yes should create an App ID early on. You can find more information on the App ID from the Apple iOS Developer Portal.
Yes, there are a number of steps involved in getting your App into the App Store. We do not control the submission process and can only point you at the steps you have to take.
I'm trying to run an iOS app but when I press the 'test' button to run the simulator I get a message saying 'Unable to start simulation: iOS simulator failed to install the application'.
I appear to have the correct SDKs installed (I get the little green box in the 'preferences/mobile support' window).
In 'standalone application settings' I have 'iOS' selected and though I have a number of different profiles I have selected each of them in turn but none seems to work.
Any clues as to what might be going wrong?
When I am at the Standalone App Settings window there is (none) on the Profile setting. I have followed all the directions to set up my developer profile and have obtained the public and private developer keys as well as two provisioning profiles and the iPhone Developer Certificate. Livecode and the apple developer stuff should be paid for. I have tested my application in the iphone simulator and it does work correctly. I have a Mac OS 10.7.4, Livecode 5.5.4, and Xcode versions 4.4 and 4.6.1.
Thank you for your assistance,
you could get that error message if you already have a stack with the same name installed on the simulator.
If that is the cause for the problem, then you can either remove the stack from the simulator, change the "Internal App ID" in the Standalone Application Settings, or you can use the reset function in your iOS simulator.
it sounds like LiveCode cannot see your Provisioning Profile. It is possible that even though you have one, it may not be installed.
Open Xcode to launch the Organizer "Window->Organizer". A new window opens.
Select the "Devices" icon a the top of the window.
On the left hand side select "Provisioning Profiles" to display what profiles are installed.
If the relevant profile is missing, then select the "Import" button at the bottom of the window and import the profile you are missing.
I have a Mac OS 10.7.4, Livecode 5.5.4, and Xcode versions 4.4 and 4.6.1.
Is is possible to build for iphone 5 only?
My stack is 1136 x 640 and it deploy ok to the iphone 5
I just downloaded the Commercial Edition 6.0.0 Build 1511 and started the How do I build an iPhone application for iOS tutorial and I already have a problem... The tutorial says:
"Open the standalone builder 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."
However, there is no iOS tab in the application settings for the new project I just created. I can see a Test Target item in the Development Pull Down Menu, but the choices there are grayed out. I am already a registered Apple iOS developer and have valid certificates. What am I missing?
You can open the Standalone Application Setting from the File menu. In there you can check the option for building for iOS. This should enable the Test option for testing on the simulator.
I hope that helps.
it is not specifically possible to build for iPhone 5, but you can limit your application to a minimum iOS version.
If you would like your application to work only on iPhone 5, then you could use the iPhoneDeviceResolution function to get the resolution of the device and determine if you would like your application to run on this device. If this function does not return the resolution your application requires, then you could launch a dialog that requests the user to terminate the application.
How about the SDK load? I started with a new install of xCode about two months ago and only have the iOS 6 libraries. When I try to build an app I get an error message that I'm missing the files for iOS 5 or that the version of arm processor I'm building for is wrong. Any suggestions?
in order to build for older versions of iOS you require older versions of xCode. Have a look at section: "Configuring LiveCode for iOS Support" of lesson: "How do I Become an iOS Developer?" http://lessons.runrev.com/s/lessons/m/4069/l/23275
This shows you how to include a number of version of xCode in LiveCode.
In that example we use xCode 4.4 and 4.5. This supports 5.1 and 6.0. I would try including something like xCode 4.3.1. This should give you support for 5.0.
I have tried to create a simple hello world application for iOS. I have a provisioning profile setup but when I try to install the app on my iPad using iTunes, it fails to install.
if you want to install an application on your iPad, then you need to subscribe to the iOS Developer Program, I assume you did that, as you have a provisioning profile.
You also need an installation of xCode and it is through xCode that you install the LiveCode application on your device. You can have a look at the following lesson for information on setting yourself up as an iOS developer: http://lessons.runrev.com/s/lessons/m/4069/l/23275
At the end of that lesson there is a further link to a lesson that gives you more information on developing for iOS.
Thank you Hanson. one reason I've experience that problem is that, I think I used the same provisioning profile which is already used by other app? I've used another valid profile which was setup by my colleague before and it works fine.
Another thing is, I've tried to create another development provisioning profile but I got "Valid signing identity not found" on the status when I install it.
Here's what I did:
1. Create another app ID under identifier and select 1 current certificate.
2. Create another development provisioning profile and used the app ID I created earlier
3. Download both the certificate and provisioning profile and install them, got not valid signing identity problem.
great, thank you for sharing your experience and solution.
The iOS provisioning process can be challenging and may require more than one attempt to get right.
We provide information in our lessons on provisioning, but this is targeted more at provisioning with regards to the requirements for LiveCode.
Apple provide detailed step by step instructions on provisioning for iOS development in their developers portal.
I have tried to download the sheep application in order to work with this tutorial, but it is only zero bytes, ergo: there is nothing to download. I went to the page you guys mention hereabove, and click on the download link. Then I a asked to save the file somewhere (like always when I download something) but when I download it, it is an empty file. I tried to rename it but it didn't help either. Any suggestions? Maybe the download link is 'dead' ?
Thanks for letting us know about this, I have updated the link in the lesson to point to
I refer to your last step of dragging the apps bundle onto the device. However the apps is all greyed out when I tried to add it not the application area. The apps was working fine in the iOS simulator and the provisioning profile has been set up correctly. What do you think is the problem and how can I resolve it? Thanks.
here are some suggestions that may help address the issue:
Depending on the version of xCode you are using, it is possible that the layout of the organizer window has changed. More recent versions of xCode have the app window on the top right.
You may also find that there is a green circle with a white "+" in it, next to the application name when you drag it onto the correct field.
Also note that the extension of the file you want to drag is ".app"
Hope this addresses the issue for you.
Thanks for your prompt reply.
Yes, I have mistaken the source code for the apps bundle. During the generation of the apps bundle, there is an error message when the checkboxes in the "Requirements and Restrictions" section are checked. Not sure why. Anyway, I was finally able to deployed the apps on my iPhone successfully.
When I do the last step in the instructions, I get an error that says "The executable was signed with invalid entitlements."
How can I tell what is amiss and what do I have to fix?
Invalid entitlements is Apple-ese for a bad "internal app id". I fixed the app name and problem is solved, so this can be dropped
Glad you got it sorted, I'm sure others will run into the same issue so thanks for posting the solution here.
RE: "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." It is most important to make sure that you are using a "Developer Certificate" to create a "Developer Provisioning Profile" to make an app that will load on an individual iPhone/iPad. If, like us, you try using a "Distribution Certificate" to create a "Distribution Provisioning Profile" this will not load on the iPhone/iPad and you could waste a lot of time wondering why.
I found this article in 2020. I'm really interested in using LiveCode to create an iOS application. Is this still compatible with current versions of Xcode and LiveCode? It seems certain aspects of LiveCode have not been updated. Just curious to know if this is still possible.
LiveCode deploys to iOS. You can check the latest compatibilities here:
To learn how to set up LiveCode to work with iOS, go here:
I hope this helps,
I have a Problem with the standalone application settings. Although i have put the right Internal App-ID, the field "profile" remains empty and i can't chance it manually either? I would really appreciate it if someone has an idea to fix this?
Are you are deploying to the iOS Simulator or a device? If you want to deploy to a device you will need a development provisioning profile set up.
Once that is set up your profile should appear in Profile menu.
I hope that helps.
Dear Elanor, thanks for your reply. Have I understood it right, that for the creation of the standalone aplication I do not need an App-ID? How can I sign my application then? Or is it signed while transporting to the iOS-Store? I do not own any device other than my macbook air (32-bit), and the simulation does not work on it, so i wanted to at least generate the standalone aplication but it's not successful.
I would appreciate any help
You can create an iOS app and test it on the iOS Simulator without an App ID. To test on a device or build a standalone you will need a certificate, development provisioning profile and App ID.
Have you already followed the steps in this lesson?
You will need Xcode installed and your LiveCode mobile preferences set up before you can test or build an iOS app.
I hope that helps.