Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i compile android project without eclipse?

Tags:

android

Hello there is one question which comes in my mind from last 2 days. Can we compile our android project without Eclipse? If yes then what is alternatives? Please share it.

like image 886
Hardik Joshi Avatar asked Apr 29 '26 15:04

Hardik Joshi


2 Answers

one option is ant, and an extremely reduced tutorial goes like this:

first update your project with a proper build script and all the files that ant needs, you can do that with just one command, for example

android update project -p . -t android-10

this command has many options, feel free to browse for those options.

after that just do

ant debug

or

ant release

depending on what you want to produce, again, ant has other variations and you can easily discover them with the Android docs.

like image 65
user827992 Avatar answered May 02 '26 05:05

user827992


If you are developing in a non-Eclipse environment, you can build your project with the generated build.xml Ant file that is in the project directory. The Ant file calls targets that automatically call the build tools for you.

Look at Here for more details.

cd /path/to/my/app
ant release

it will ask you every time for your private key to sign the app, it can be configured to auto-sign by editing "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 investigate Android SDK, find the ANT build scripts it actually uses, and insert your custom obfuscator/optimizer call in middle of build process.

like image 31
Chirag Avatar answered May 02 '26 06:05

Chirag