How to include version string in the filename when building Android apk with ant?

前端 未结 4 1571
不知归路
不知归路 2020-12-24 02:58

Normally we build android package in debug mode with the command

ant debug

and got the apk filename AppName-debug.apk.

4条回答
  •  时光取名叫无心
    2020-12-24 03:10

    Another, more Android-like solution is to use the XPATH task as it is done in the ${sdk.dir}/tools/ant/build.xml:

    
    
    

    This requires the definition of the task:

    
        
    
    
    
    

    I don't know which is the minimum SDK version, but it works with SDK14.

    Regards, Michael

提交回复
热议问题