Configuring libGDX project for desktop and Android

posted in: Android, Guides, Java, libGDX | 0

After you downloaded and generated your libGDX project for android. It’s really handy to be able to test your mobile game on desktop while building it.

Here are the steps needed in Android Studio to configure your project to easily run it on desktop environment.

First, open the project, you should see something like this:

Selection_005

In the toolbar, create a new launching configuration:

Menu_006

 

Click on the “+” icon to add a new configuration and select “Application”.

Menu_007

Fill in the required fields as follow:

Selection_009

Now you should be able to launch your project on desktop:

 

Selection_010

 

Remember on the last step, the fields are dependent on my project name! It is important to select the main class and the working directory should by the asset folder of your android project.