Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7911319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:11:56+00:00 2026-06-03T13:11:56+00:00

I am using Ant to build my Android project. The Android project is checked

  • 0

I am using Ant to build my Android project. The Android project is checked into Tortoise SVN. Now when I create a build I want the apk files to ideally get generated into different folders on windows stating the version number of the build. For example on first build (ant release) I would like to have the folder bin/1.0/sample.apk and for the next bin/2.0/sample.apk so I cant maintain different versions.And ideally the version numbers should be version number of the manifest(right?). How can this be done ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:12:01+00:00Added an answer on June 3, 2026 at 1:12 pm

    You can have a custom_rules.xml file in your project that contains the statements for copying your apk to the required folder in a -post-build target. You can use the copy task to take care of it.

    To retrieve the version information from the manifest, follow this answer on SO.

    A sample of the custom_rules.xml would be:

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="custom_rules">
        <xmlproperty file="AndroidManifest.xml" prefix="mymanifest" collapseAttributes="true"/>
        <property name="build.dir" value="bin/${mymanifest.manifest.android:versionName}/" />   
        <target name="-post-build">
            <echo>Version is ${mymanifest.manifest.android:versionName}</echo>
            <copy toDir="${build.dir}" >
                <fileset file="${out.final.file}" />
            </copy>
        </target>
    </project>
    

    Note: Currently, the apk is copied to a sub-folder of ‘bin’ folder. You would have to think of another directory as the ‘bin’ folder will be deleted on every clean operation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build my android project using ant in command line mode.
I've generated ant build.xml for my android project, using android update project --name <project_name>
I am using Ant > 1.8 + Proguard 4.6 to build my Android project
I want to be able to build .apk files programmatically given Android projects (folders,
Hi I am using ant to build a scala android project. It seems my
I have an android project with multiple build targets (using ant). For testing purposes,
Im using an ant build file that has been generated by android. Our Android
I'm trying to build my project using ANT. My project uses ActionbarSherlock, and Roboguice-Sherlock.
I have a Java project that I build using an Ant script. I am
When using an Android-generated ant build file, the file references your SDK installation via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.