Create an iOS Application with PhoneGap
In this section, we’ll look at how to turn a game made in TyranoBuilder into an iOS application.
This requires the use of some free third party software, but as you’ll see it actually takes very little technical expertise!
Pretty much anyone can create an iPhone or iPad application by following the below steps!
In this case, we’ll look at how to create an iPhone application, and the first thing you’ll need to create an iOS application is:
・A computer running MacOS
Yes, sorry – Windows cannot create iPhone applications. If you don’t have one, but try borrowing MacBook from a friend or Mac Mini’s are pretty cheap!
Once you have your Mac to work with, just follow the steps below. Let’s get started.
You’ll need the latest version of a free software development called Xcode installed on your Mac.
To find and install it, open up the AppStore, search for ‘xcode’, then follow the instructions to install it.
The next tool you’ll need is a utility called PhoneGap which is available from the official PhoneGap website at the below link.
At the time of writing, the latest version of PhoneGap is v3.3, so our tutorial is based on that version.
To use PhoneGap, we’ll need NodeJS installed.
Download and install NodeJS from the below site.
Click Install at the top right of the website to download NodeJS, then follow the install the instructions.
Now we have everything we need prepare our app!
First, create a new folder for the app in a suitable location on your computer, such as your Desktop.
We’ll call our folder ‘iphone’.
Drag and drop the created folder to the black icon (screenshot to follow!) in the tool bar.
This will open a completely black console window.
In the console window, enter and execute the following commands in order.
(You can copy and paste the commands from the tutorial and use the Enter key to execute them.)
sudo npm install -g phonegap
Create an Application (named ‘myapp’):
phonegap create myapp com.myapp "myapp" cd myapp phonegap plugin add org.apache.cordova.media
Next, we prepare the TyranoBuilder project folder.
Copy all of the files from the exported TyranoBuilder project to the folder iphone/myapp/www/
Almost there! Only a little more step to go.
Go back to the console (completely black) window and type the following:
phonegap build ios
This will create the file myapp/platforms/ios/myqpp.xcodeproj
Go ahead and run this file, and Xcode will start up.
Now, confirm the hardware type (e.g. iphone Retina(3.5inch)) in the upper left area in the screen and press the Play button.
How did it go?
The game started up, right?
And that’s it! That’s all you do to prepare an iPhone application!Tips
Use the ‘Deployment Info’ options if you would like to lock the screen rotation for your game.
You can also control features such as the clock or battery level indicator from these options.
One other tip: smartphone screens these days are not all the same size, so depending on the resolution of your game, there may be black borders around the game.
To ignore the aspect ratio and use full screen for your game, use a text editor to open the file / system/Config.tjs in your TyranoBuilder project folder and make the following revision.
Change ;ScreenRatio = fix; to ;ScreenRatio = fit;
Our tutorial ends here for now, but there are many sites that provide instructions about how to run the app on your own mobile device, or how to set up and sell your game on the AppStore. (We’ll expand this tutorial to provide instructions for these soon!)