Compile android project in apk without eclipse

What I did - I took the class files from my eclipse project and run them through the optimizer / obfuscator. So now I have optimized file classes that I want to get as apk so that I can sign and publish it. However, I am lost on how to do this. I guess I can't just copy them to the bin folder of my eclipse project, because eclipse would just overwrite them with a new compilation when I try to export the signed apk. So how do I create apk from these file classes?

+3
source share
2 answers

you can try putting them in bin / classes and then use the "ant" command to create your application

cd /path/to/my/app ant release 

he will ask you every time your secret key is signed by the application, you can configure it for automatic signing by editing the build.properties file:

 key.store=release.keystore key.alias=release key.store.password=my_key_password key.alias.password=my_key_password 

you can also research the Android SDK, find the ANT build scripts that it actually uses, and insert your obfuscator / optimizer call in the middle of the build process.

+11
source

Here is an example:

 android create project \ --target 1 \ --name MyAndroidApp \ --path ./MyAndroidAppProject \ --activity MyAndroidAppActivity \ --package com.example.myandroid 
-1
source

All Articles