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:
In the toolbar, create a new launching configuration:
Click on the “+” icon to add a new configuration and select “Application”.
Fill in the required fields as follow:
Now you should be able to launch your project on desktop:
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.