开发者

How can I build multiple Android app builds for beta testers and for the Market?

I would like to produce 2 builds of my Android app:

  • one build which will be as close as possible to what ends up on the Android Market when I release it, and which will be distributed to testers who do not work at my company
  • one build which will be tested internally by programmers at my company. This will be very similar to the other build, but will have some extra functionality, like being able to configure (at runtime) which server environment it talks to

Is there an easy way to modify my build to build both these artifacts? If I could just set a single variable's value to something passed in on the command line during the build, I could dispatch on that value in different parts of the app for different behavior. However, I'm not sure that's the best way to do this, nor do I know a good way of getting that into my code.

I'm using the off the shelf build开发者_JAVA技巧.xml file that Android produced for me right now.

Thanks!


When you have an automatic build chain (i.e. running everything through ant), you can create one java file that contains that variable from the ant run. And here you can set the variable depending on the target environment. The build will then compile that file with all others and package it up.

It may be possible to also have a replace task in ant, that takes an existing file and just replaces a token ##var## with the variable content.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜