4

I have read this article about deploying libgdx application on linux, windows and macs.

However, it only describes how to export using eclipse. I am currently using Android Studio and it deploys android *.apk files very nicely. And I intend to keep using this. However, I had not figured out a way to deploy the desktop version of the project.

Can anyone tell me how to deploy a Libgdx Desktop application with Android Studio (or Intellij Idea because they are pretty much the same).

  • So are you successful? I can run the desktop app fine but does not know how to deploy. Have you tried others like iOS? – Lim Thye Chean Aug 14 '15 at 4:16
3

Yes, tell Gradle to build a jar for you. Here's how.

In Android Studio you can start the Gradle tasks from the GUI on the right side. Anyways, I recommend you to learn first without an IDE.

|improve this answer|||||
  • Yes, I like your link, but I still don't understand how to do it exactly. Where do i type gradle uploadArchives? – Fish Apr 29 '15 at 10:40
  • Well, gradle is a command-line tool, and you specify the tasks on the command-line, but in Android Studio you can start them from the GUI on the right side. Anyway, I recommend to learn first without an IDE. Here's a simple tutorial: spring.io/guides/gs/gradle – lbalazscs Apr 29 '15 at 15:19
  • And here is a libgdx-specific tutorial: github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline – lbalazscs Apr 29 '15 at 15:21
1

You can setup Android Studio to run the desktop version by setting up a new run configuration. Then you can run the desktop version just like you would the Android version.

Follow this link: Configuring a libGDX project to run as a desktop application in Android Studio.

|improve this answer|||||
  • 1
    He is asking how to create a runnable JAR file, not running app in Android Studio. – Lim Thye Chean Aug 17 '15 at 14:24
  • This was the answer to the question I asked Google, even if it isn't the answer to the original question. – Nicholas Pickering Jun 17 '16 at 2:56
0

A simple way of deploying on windows is to make a jar using gradle with the command gradlew desktop:dist in terminal. A similar command can be used on Linux as well.

|improve this answer|||||
0

In GUI we can do it.

Menu: Run -> Edit Configurations -> Add New Gradle Configurations

Gradle project: choose main Gradle project

Taske : gradlew desktop:dist

Then Run this configuration.

From this link: exporting-a-libgdx-game-as-executable-jar-from-android-studio

|improve this answer|||||
9

you can simply click on Gradle panel in the right, select :desktop, press the Execute Gradle Task, type dist and press enter, that's it.

Jar is located in /desktop/build/libs.

lbalazscs gave you a more detailed answer, so i recommend you doing what he said.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.