Configuring a libGDX project to run as a desktop application in Android Studio

The following will quickly cover how to setup a newly imported libGDX project to run a desktop application, via Android Studio 1.1.0.

This assumes that you have already created a new libGDX project and have already imported it into Android Studio. If you have not, please review Creating your first libgdx project with Android Studio 1.1.0.

With the project imported, select the configurations drop-down, or navigate to Run > Edit Configurations...` in the menu.

Next click the green plus sign in the top left corner and select 'Application.'

There are now four fields you need to populate to complete this step.

Name: Enter whatever you'd like. I like using 'Desktop' to be obvious.

Main class: com.xxx.desktop.DesktopLauncher

Working directory: C:\Path\to\project\android\assets

Use classpath of mod: select the desktop module

And that's it. You should be able to select and run the configuration.

If you work on multiple machines, note that by default this configuration change will mostly likely not be checked into source control. The file that contains this configuration is located in your project directory under \.idea\workspace.xml.