JohnRock
JohnRock

Reputation: 6875

Android: How to set the name of the compiled APK?

This question seems embarassingly simple, yet it vexes me still. I am using the standard ADT and Eclipse Android environment to build my Android app. The apk is named after the project name in Eclipse, but I want to name the apk something different...How can I customize the name of the apk artifact that is produced when the project builds?

Upvotes: 7

Views: 14622

Answers (5)

Himawan
Himawan

Reputation: 1

If you just want to change the apk's name that appears on the smartphone's screen, you just need to go to click your project > res > values > string.xml then on app_name field inside the >< renamed the apk's name as you want.

enter image description here

Upvotes: 0

Santosh Shinde
Santosh Shinde

Reputation: 6053

Please Try This...

Please First Change \android-sdk\tools\ant\build.xml for signed release apk
These changes are onetime in build.xml because of this file every time use with your project build.xml to generate apk

<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-release.apk" />

By

<property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}.apk" />


Then execute command :
android update project --name your_desired_name --path .
ant release

Release APK Created in directory YourProjectName\bin by name :

your_desired_name.apk

Upvotes: 0

Aki
Aki

Reputation: 3839

You can also just edit the build.xml as following:

<project name="YourNewProjectNameHere" ...

if you are building with "ant" on the command line. Otherwise, Eclipse will always use your official ProjectName when create an apk. However, you can override that by right-clicking on project, and selecting Android Tools->Export Signed Application Package; which will then allow you to specify your own name for the package.

Upvotes: 5

Vadym Radionov
Vadym Radionov

Reputation: 91

android update project --name your_desired_name --path .

ant debug

Upvotes: 9

JohnRock
JohnRock

Reputation: 6875

I am very surprised that there apparently is no way to do this, but alas I found that when finally exporting a signed apk file through eclipse you can specify the name of the APK. So that solves my problem.

Upvotes: 1

Related Questions