Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Running and packaging your project

Tomas Slusny edited this page Aug 17, 2015 · 11 revisions

This article will show you how you can run your application from the command line and package it for distribution for the different platforms!

Contents

Running the project

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.

Desktop - Android - iOS

Running the desktop project

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!

Running the Android project

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.

Running the iOS project

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!

Packaging the project

Every platform has a different kind of distribution format. In this section we'll see how we can generate those distributions via Gradle.

Desktop - Android - iOS

Packaging for the desktop

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!

Packaging for Android

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.

Packaging for iOS

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

Common problems

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 run luarocks 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.