<table width="100%" class="navigation">
<tr>
<td width="33%" align="left">
<a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Creating+Unit+Tests">Previous</a></td|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3EPrevious%3C/a%3E%3C/td]>
<td width="33%" align="center"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA">Top</a></td|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3ETop%3C/a%3E%3C/td]>
<td width="33%" align="right"></td>
</tr>
</table>

{redirect:https://www.jetbrains.com/idea/help/generating-signed-and-unsigned-android-application-packages.html|delay=0}

Once compiled, an Android application is packaged as an APK file. The package contains binaries as well as resources. Android applications can be published to an app store such as Google Play or just directly installed on devices configured to install applications from unknown sources.
You can't publish an application to any app stores if the package isn't digitally signed. To sign the application, you must first obtain a certificate. The certificate will be used to identify you as the author of the application.

1. Get a certificate

The Java SDK provides a tool for generating and managing certificates a certificate. It is the keytool application and it is available in the Java SDK directory. For Android development, there's no need to buy a certificate from an authorized certificate authority; a certificate self-issued using keytool is more than acceptable for the purpose of publishing the application.

Note: You can also create a certificate from within IntelliJ IDEA.

2. Sign the application

Once you hold the certificate you need to compile the application for release and sign the resulting executable. Also for signing, there's a Java SDK command-line tool: the jarsigner tool. This tool is often integrated in the IDE of choice; this is precisely the case with IntelliJ IDEA.

To start the wizard that signs an application, you click Build|Generate signed APK.

3. Get a certificate from IntelliJ IDEA

If you haven't created the certificate yet, you can do that from within the previous dialog box. You just click on Create new and get displayed the following dialog box.

 

4. Deploying the application

At the end of the wizard, you still have an APK file compiled for release and digitally signed. This is just the file to upload to the app store of choice or to pass around to install directly on enabled devices.

For more detailed information on packaging and distribution of Android applications, you might want to check out the documentation on the Android developer site.

<table width="100%" class="navigation">
<tr>
<td width="33%" align="left"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Creating+Unit+Tests">Previous</a></td|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3EPrevious%3C/a%3E%3C/td]>
<td width="33%" align="center"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA">Top</a></td>
<td width="33%" align="right"></td>
</tr>
</table>