-
Notifications
You must be signed in to change notification settings - Fork 5
Running and packaging your project
This article will show you how you can run your application from the command line and package it for distribution for the different platforms!
- Running
- [Running on Desktop] (#running-the-desktop-project)
- [Running on Android] (#running-the-android-project)
- [Running on iOS] (#running-the-ios-project)
- Packaging
- Packaging Desktop
- Packaging Android
- Packaging iOS
- Common problems
Yae let's you easily run a project from the commandline. Just use the yae command specify your target platform and the run command for that platform.
yae run desktop
This compiles your core and desktop project, and runs the desktop starter. The working directory is the android project's assets folder!
yae run android
This task will create a debug APK of your application, install it on the first connected emulator or device and start the main activity.
yae run ios
This command will launch your app on an iPhone simulator. Note that the first time you run your iOS project, the compilation will take a long time. Compilation time will decrease significantly on subsequent runs!
Every platform has a different kind of distribution format. In this section we'll see how we can generate those distributions via Gradle.
yae build desktop
This will create a runnable JAR file located in the build/desktop/
folder. It contains all necessary code as well as all your art assets from the android/assets folder and can be run either by double clicking or on the command line via java -jar jar-file-name.jar
. Your audience must have a JVM installed for this to work. The JAR will work on Windows, Linux and Mac OS X!
yae build android
This will create an unsigned APK file in the build/android/
folder. You can install this APK file on any Android device that allows installation from unknown sources. For distribution on the Google Play Store you have to .sign your APK. See Signing your application guide.
yae build ios
This will create an IPA in the build/ios/
folder that you distribute to the Apple App Store. You can follow Apple's guide on app store distribution
Important: If you are encountering any sort of problem, try running yae clean
to clean all temporary data, most of times this simple task can solve it.
-
Build failing with
moonc
error - Can happen on Windows. Just runluarocks remove moonscript --force
and download latest MoonScript Windows binaries. -
AVG - When running
yae build desktop
antivirus will cause this to fail. Add an exception to your antivirus to allow access. - Cannot build for iOS - To make games for iOS you will need to own Mac (thanks to apple). See Getting started guide.
NOTE: Some tutorials are edits of LibGDX tutorials, what can be found here.