Hello Boldizsár,
It's a bit outdated, but you can try my Medium article to get more infos:
https://vstram.medium.com/mendix-b554e0678c72
in which is presented a python script to locally generate your APK/AAB from your project.
Basically, you have to:
You have to have the Android SDK installed in your system.
To generate the unsigned Release APK you should use:
To sign your APK you can use Android Studio to generate the *.keystore file.
More details in this link:
https://developer.android.com/studio/publish/app-signing
Hope this info helps!
There are detailed instructions in the Android Studio documentation, which you can find here. That first link is for building a publishable apk. If you just want to build an APK for testing it on your emulator / own devices, you can follow these steps instead.