One, generate a certificate
In here generate your test certificate, and then download it; (if the site is not available, we can own Google Android certificates online authoring tool)
Two, generate apk
We choose Build -> Generate Signed APK
Will appear:
We click choose existing, select the certificate just generated, click OK, click finish
At this time, the point of android studio will appear
Compiling, when the upper right corner of AS appears, it
means the packaging is successful.
Click directly to open the location of the generated apk file
Reference: https://blog.csdn.net/woaichimahua/article/details/54427528