IntelliJ IDEA 13.0.0 Web Help

Some features described here are available in Ultimate edition only.

To deploy and run an Android application on a physical device, you need to sign the application digitally. With IntelliJ IDEA, you can have your Android Application Package (.apk file) signed with an existing release key during the package extraction. IntelliJ IDEA also incorporates a release key generation tool that can be invoked during packaging. Generated keys are saved in a keystore binary file.

You can have as many keystore files and keys as you need and use either previously created keys, or create new ones in existing keystores, or even create new keystores.

If you use the Generate Signed APK Wizard, IntelliJ IDEA signs the package during extraction.

On this page:

Extracting and signing an Android application package using a wizard
  1. On the main menu, choose Build | Generate Signed APK. The Generate Signed APK Wizard starts.
  2. On the first page, specify the release key to use and the keystore file that contains it. Do one of the following:
    • To have the package signed with a key from a previously generated keystore file:
      1. Specify the file location in the Keystore path text box. Type the path manually or click the Choose existing button and choose the file in the dialog that opens. In the Password text box, type your password to access the selected keystore.
      2. Specify the key alias and the password to access the key.
    • To have a new key generated in an existing keystore:
      1. Specify the keystore location and password in the Keystore path and the Password text boxes respectively.
      2. Click the Create new button and configure the release key to be generated by filling in the data in the New Key Store dialog box that opens.
    • To have a new keystore file with a new key generated:
      1. Click the Create new button. In the New Key Store dialog box that opens, specify the location of the file to be generated in the Key store path text box. Type the path manually or click the Browse button browseButton.png, then select the parent folder and specify the name of the file.
      2. Specify and confirm the password to access the keystore.
      3. Configure the release key to be generated by filling in the data in the Key area. The procedure is identical no matter whether you are using a wizard or an artifact definition, see Generating a Signed Release APK Using a Wizard: Generating a new release key for details.
      4. Click OK when ready. IntelliJ IDEA brings you back to the first page of the wizard, where the keystore location, the key alias and passwords to access them are filled in in the corresponding fields.

    Click Next. IntelliJ IDEA brings you to the last page of the wizard.

  3. In the Destination APK path text box, specify the folder to store the package .apk file in. Type the path manually or click the Browse button browseButton.png and select the package output folder in the Choose destination APK file dialog box that opens.
  4. To have IntelliJ IDEA obfuscate the application during packaging, select the Run ProGuard check box and specify the location of the proguard.txt configuration file. The file is generated during project creation and is stored in the project root. IntelliJ IDEA suggests this default location in the Config file path text box. Accept the suggestion or specify a custom configuration file by clicking the Browse button browseButton.png and selecting the required file in the dialog that opens.
  5. Click Finish to have the package generated and signed. When the package is generated, IntelliJ IDEA informs you about it in an information message.
    • To open the folder where the generated .apk file is stored, click the Open File Location button.
    • To leave the wizard, click Close.
Generating a new release key
  1. Open the New Key Store dialog box by doing one of the following:
    • On the first page of the Generate Signed APK wizard, click the Create new button.
    • During creation of an Android Application artifact definition, click the Create new button in the Android tab.
  2. Specify the keystore location and password in the Keystore path and the Password text boxes respectively.

    Note

    If you are going to add a new key to an already existing keystore and have already chosen it in the wizard or in the Artifact tab, these fields are already filled in.

  3. Assign an alias to the new key in the Alias text box. The key will be referred to using this alias.
  4. Specify the password for the key in the Password and Confirm text boxes.
  5. Specify the validity period for the key in accordance with the expected lifespan of your application.
  6. Provide the following personal information:
    • First and Last Name
    • Organizational Unit
    • Organization
    • City or Locality
    • State or Province
    • Country Code
  7. Click Next. Depending on your workflow, IntelliJ IDEA brings you to the last page of the Wizard or to the Android tab.

See Also

Procedures:

Reference:

External Links:

Web Resources: