Packaging a LibGDX project

Packaging your application is easy as one command line task invocation. Its recommended you use the gradle tasks to package your app, as they are already wired up to bundle everything you need for each platform. However if you feel comfortable setting this up in your IDE by yourself, feel free!

Packaging for desktop

./gradlew desktop:dist

Generates a fat jar in desktop/build/libs directory that you can run with

java -jar desktop.jar

Further Packaging desktop

You can wrap this jar into a .EXE bundle along with a small JRE so that your end users don't have to have java installed. PackR is a wonderful tool that allows you to do this.

Packaging for Android

./gradlew android:assembleDebug

Will generate a debug APK in android/build/outputs/apk that you can send to users manually if they have disabled APK source checking.

To generate a signed APK, you can follow the guide here: Android Signing This goes through how you can do this in Intellij and Android studio, but also on command line. See the "Configure Gradle to sign your APK" section for this.

Packaging for RoboVM

Its recommended you use your IDE plugin to package for RoboVM.

  • Create an IPA in Intellij/Android Studio documentation here
  • Create an IPA in Eclipse documentation here

Alternatively run:

./gradlew ios:createIPA

This will require you to setup additional configuration in the build.gradle file for robovm. See documentation

Packaging for Multi-OS Engine

See the official documentation for building an IPA with Multi-OS Engine here

Packaging for HTML

Run the following Gradle task to package the HTML project:

./gradlew html:dist

This will create the resulting javascript and assets in the html/build/dist folder. You have to serve these files by a webserver, (e.g. Apache/nginx)