Question

How can I build and signed (keystore) the .apk file using 'apkbuilder.bat' via windows command-line ?

I try to run the following line:

apkbuilder.bat %APK_File_Name% -u -z %Project_Path%\bin\resources.ap_ -f %Project_Path%\bin\classes.dex -rf %Project_Path%

but I'm getting the following exception:

java.lang.ArrayIndexOutOfBoundsException: 1
 at com.android.sdklib.build.ApkBuilderMain.main<ApkBuilderMain.java:61>

Please help. Thanks

Was it helpful?

Solution

You can do it in command line (.bat) in windows using ant.

with: "ant release" You build the apk unsigned.

Then you need to add the call to "jarsigner" and "zipalign" in the bat to complete the task.

You can find an example of the command line to call these tools here: http://developer.android.com/guide/publishing/app-signing.html#signapp

Best,

OTHER TIPS

I would suggest using Ant and the build files generated by the Android tools rather than trying to handroll your own. If nothing else, you can use the build files as a reference to determine how it uses the various tools to perform each step.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top