When creating an android project with the ant debug command, my apk has the word debug attached to the name. How do I change it?

I use "ant debug" to create my project. After building with this command, my apk name is sample-debug.apk (my project name is sample). I want it to be sample.apk after its creation. How can I do this by changing build.xml.

please do not suggest me rename apk after its creation.

+4
source share
3 answers

There are no technical reasons for changing the name, but if you want to be able to overcome the basic ant task that sets debugging options. Currently it looks like this:

<target name="-set-debug-files" depends="-set-mode-check"> <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}-debug-unaligned.apk" /> <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}-debug.apk" /> <property name="build.is.mode.set" value="true" /> </target> 

You can paste this into your local build.xml file above the import statement and change the values ​​to suit your needs.

I hope this helps.

+8
source

I do not think you should change the name of your .apk file. I just found the description in the first paragraph on page 265 of this fragment of a Google Pro Android Python book with Sl4a . With this naming convention, you can easily see what type of apk file you are working with.

+1
source

It is very simple. Refer to this link [1]: https://ant.apache.org/manual/running.html

So, in the above case, we need to run debug like this,

ant debug -Dout.final.file = brandA.apk

Here it is.

0
source

Source: https://habr.com/ru/post/1403083/


All Articles