自动递增的版本code在Android应用 [英] Auto increment version code in Android app

查看:133
本文介绍了自动递增的版本code在Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法自动递增的版本code每次在Eclipse构建Android应用程序?

is there a way to auto-increment the version code each time you build an Android application in Eclipse?

据<一href="http://developer.android.com/guide/publishing/versioning.html">http://developer.android.com/guide/publishing/versioning.html,你必须手动增加你的版本code。在的Andr​​oidManifest.xml

According to http://developer.android.com/guide/publishing/versioning.html, you have to manually increment your version code in AndroidManifest.xml.

我明白了,你必须每次生产前这将,比如运行一个脚本解析AndroidManifest.xml文件,查找版本号,增加它和文件本身开始构建之前保存。不过,我无法找出如何,如果Eclipse支持奔跑脚本前/后建立

I understand, you have to run a script before each build which would, e.g. parse AndroidManifest.xml file, find the version number, increment it and save the file before the build itself starts. However, i couldn't find out how and if Eclipse supports runnings scripts before/after builds.

我发现这篇文章有关配置Ant构建器,但这不正是关于Android,我担心这会搞乱了太多的predefined建设步骤为Android?

I have found this article about configuring ant builder, but this is not exactly about Android and I fear this will mess up too much the predefined building steps for Android?

应该是一个普遍的问题,你是怎么解决的呢?

Should be a common problem, how did you solve it?

好了,你可以手动做到这一点,但只要你忘记这样做家务,你会得到不同的版本与相同数量和整个版本没有什么意义。

Well, one can do this manually, but as soon as you forget to do this chore, you get different versions with the same number and the whole versioning makes little sense.

推荐答案

所以,我认为是这样的:

So, I see it like this:

根据文章,你present,使用的蚂蚁的这个任务(目标?)。

Depending on article that you present, use ant for this tasks (targets?).

  1. 解析清单(解析XML)
  2. 在得到老版的形式表现,并增加它/从式回购获得的版本
  3. 在店新版本清单
  4. 在构建Android应用程序。

但是我我来说,我通常是由价值填补了这一领域的基础上的标签的的版本,当我部署或分发应用程序。

But im my case I usually fill this field by value based on Tag's revision when I deploy or distribute application.

这篇关于自动递增的版本code在Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆