orchidrudra
orchidrudra

Reputation: 1172

Custom ant task to automate android apk generation

I want to automate my android apk generation process. The app fetches data from server, I have two servers, one is for testing which contains dummy data, and the other one for actual release which contains real data. URL of those servers are mentioned within strings.xml file.

Now I need a custom ant task for generating two different apks, one pointing to the test server and the other one pointing to the real server.

My problem is, I don't know how to write strings.xml file from ant script so that it can change the URLs accordingly.

Upvotes: 1

Views: 444

Answers (1)

ct_rob
ct_rob

Reputation: 521

You could use the replace task in ant. Something like this:

<replace file="res/values/strings.xml" token="@@@" value="http://myUrl"/>

Upvotes: 3

Related Questions