问题
Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way to export this as a executable jar file?
回答1:
Type the command below in the terminal. Remember that you have to be in your LibGDX root directory, before issuing this command.
gradlew desktop:dist
More at: https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop
回答2:
You have to type
gradlew desktop:dist
command in Terminal in Android Studio. Then you should have an executable jar file in your project directory/desktop/build/libs.
来源:https://stackoverflow.com/questions/32302235/exporting-a-libgdx-game-as-executable-jar-from-android-studio