Looking closer – iOS

Ah iOS! The platform that transformed mobile app development and brought it to the mainstream. Hey! You are probably wondering that LibGDX is a Java-based framework, so how on earth does it run on iOS? Apple banned Java Runtimes long ago. Well you are correct, the game isn't exported as you might think it is. In fact, an additional tool called RoboVM is used. RoboVM's project aim was to allow Java developers to develop the game on the iOS platform, and the best bit is that the game will have a native-style performance. It doesn't need a runtime to launch. How is this possible? Well, RoboVM compiles the bytecode, generated by the Java compiler, with machine code.

To check out RoboVM, visit its website, http://robovm.com/.

LibGDX and RoboVM have what seems to be a tight partnership and work extremely well together. In fact, out-of-the-box—the project set up tool—you can build applications for iOS with RoboVM.

I would like you to note now that like we did for Android, I am not going to cover how to set up an Apple Developer account or create provisioning profiles, key chains, and so on. There are plenty of documentation available on this topic.

Check out Apple's developer site https://developer.apple.com/ for more information,

As before, like Android, you can see that we have an iOS submodule and it contains the configuration required to create an IPA—an IPA is equivalent to Android's APK. For development, you can dive straight in. For releases, it is a bit more involved in the game. To release the game, you will need to be on a Mac—I use a Mac Mini and solely for release purposes. You will need Xcode installed—this is available from the App Store on the Mac, a developer account, and Xcode signed in with that account.

If you look at the iOS submodule, you will see an IOSLauncher class. When you look, you will see some familiar code, essentially, the platform configuration and an instantiation of our game.

To build a debug IPA, you can use the command line and run the following:

gradlew ios:createIPA

However, this isn't of much use to us; you can launch the simulator, as follows:

gradlew ios:launchIPhoneSimulator
gradlew ios:launchIPadSimulator

If you have a device connected to a Mac, use the following:

gradlew ios:launchIOSDevice

This is really about it for iOS. It is that straightforward. Thanks to the use of a developer account and Apple's xcode application, everything was automatically signed and verified for us.

For more information on how to distribute your game on iOS, I recommend you to visit https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/Introduction/Introduction.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.72.245