Generate apk name as package name in Android Studio

Bangaram picture Bangaram · Sep 8, 2015 · Viewed 9k times · Source

Android studio will generate default apk name as app-(release|debug).apk.
How to generate apk file name same as package name of the app like com.example-debug.apk.

Answer

Gabriele Mariotti picture Gabriele Mariotti · Sep 8, 2015

You can do it without using another tasks, setting the archivesBaseName.

For example:

 defaultConfig {
      ....
      project.ext.set("archivesBaseName", "MyName-" + defaultConfig.versionName);

  }

Output:

MyName-1.0.12-release.apk

In your case:

project.ext.set("archivesBaseName", "com.example" );