开发者

Workarounds for Android build script bugs

Android provides a system to autogenerate build scripts for a test project. Pretty cool... there's just two problems with it.开发者_如何学Go

  1. The build always claims to succeed when the tests fail.
  2. The tests require you to start an emulator before you run the run-tests target; the scripts provide no way to automatically start/stop the emulator.

Are you actually using the Android test scripts? If so, how do you workaround these problems? Do you leave an emulator running all the time? Read the logs for build failures? Are there other workarounds I need to know about?


We use ant build scripts extensively for our android projects and we custom rolled the ant scripts. If you look in /tools/ant folder, you will see a file called main_rules.xml (available from android 2.3 on I think). This is the main file and has all the targets to do the builds, including launching the emulator. What you need to do, is to extract targets selectively into your build.xml file, and modify them to suit your own needs.

Doing it this way will allow you to customize pretty much everything for builds. This is about say 2-3 day task, but the benefits are manifold. It also helps developers know more about how the app is built, which is always a good thing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜