Developing an application in the studio. Both the client and server parts were still one, but it was necessary to start the server remotely, then connect to it with a client. Compiling an APK file is elementary, but I didn’t figure out how to build a jar to start the server. Maybe someone came across?
As advised by @Yuriy SPb, I opened the Gradle panel, but did not find in it the assembleDebug / resease needed for assembly. I use LibGDX, the server starts in the main method of a separate class. 