Reputation: 369
I am new to ant scripting but want to achieve some task where I am totally stuck might some one can help me out with it,
What is the objective ?
What environment is setup?
Problem to be solve. on build.xml following target added
<target
name="-package-resources"
depends="-crunch" >
<echo>Repackaging AndroidManifest.xml to ${package.manifest.name} ${out.absolute.dir}/${resource.package.file.name}</echo>
<exec executable="${aapt}" failonerror="true">
<arg value="package" />
<arg value="-f" />
<arg value="--auto-add-overlay" />
<arg value="-M" />
<arg path="AndroidManifest.xml" />
<arg value="-S" />
<arg path="${resource.absolute.dir}" />
<arg value="-A" />
<arg path="${asset.absolute.dir}" />
<arg value="-I" />
<arg path="${project.target.android.jar}" />
<arg value="-F" />
<arg path="${out.absolute.dir}/${resource.package.file.name}" />
<arg value="--rename-manifest-package" />
<arg value="${package.manifest.name}" />
</exec>
from the above added script in build.xml when run through
ant debug -Dapp.custompackagename=com.example.testpackageTwo
can successfully repackage the android project, and output apk is debug.apk but when run ant release on same project it execute.Then outout singed APK is not be able to install on device from ant release
- Is there any way to use conditions in ant script to switch between ant debug and ant release to by pass the above add script. - or any other way to get release apk. after repackaging from ant debug
Upvotes: 2
Views: 475
Reputation: 38157
Android already offers the commands
android update project
and
ant debug install
and
ant release install
Upvotes: 1