Dan Fabulich
Dan Fabulich

Reputation: 39593

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.

  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?

Upvotes: 0

Views: 206

Answers (1)

omermuhammed
omermuhammed

Reputation: 7385

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.

Upvotes: 1

Related Questions