I love Android but I really hate Eclipse, and the whole IDE paradigm in general. I prefer to do development using Vim, screen, and a few shells running whatever commands are relevant for the project I'm working on. However, the Android project make it pretty clear that they support Eclipse+ADT first and foremost, so I gave it a try, if only to see what magical features I would need to figure out how to replace. Thankfully, doing so is pretty easy. Here's what you need to do to develop for Android with just a shell and your favorite text editor.
Ant is the build tool you'll use to build and deploy your
project while developing, and to make a release when ready. But you can't
run Ant in a project created in Eclipse with ADT, because ADT
doesn't give you the necessary build files. But they're easy to populate,
android update project.
android update project, you need to find out the
ID of the target you want to use for your project. Run
targets and find the ID for your target. Now run
update project --target your-target-id --name your-project-name --path
/path/to/your/project. It will populate your project with
local.properties. It'll also say that
default.properties, but it left it unchanged for
Bonus tip: If you want to avoid Eclipse completely and start your project
from scratch on the command line, you can simply run
project with the
options populated appropriately. This is the more direct route, instead of
starting a project in Eclipse and then later running
project like I did.
This part is simple. See
ant help for more details.
ant compilewill compile your code and re-generate
ant debugwill do the above, plus build and sign a package (apk) file.
ant installwill do all of the above plus install it to the emulator/phone.
I don't like Eclipse but I do like that it automatically launches my app on the emulator when I build it. It took some asking in IRC to figure out how to do this, but here it is:
adb shell 'am start -n your.package.name/.YourActivityName'
So a full build+run command might look something like:
ant install && adb shell 'am start -n your.package.name/.YourActivityName'
See what your app is saying with
Install exhuberant-ctags and run
ctags -R src gen in the root
of your project to generate a
tags file that many editors will
automatically use for autocompletion.
I'm planning on eventually writing a script that uses inotify
inotifywait -m -r) to watch for source code changes and
automatically rebuild and re-scan the code with ctags. (Although I'm not sure
if editors will detect changes to the tags file on the fly... must research
There are some parts of Eclipse/ADT that don't really have direct replacements; for example, the wizards for editing AndroidManifest.xml. In this case you'll just have to edit it by hand, but if you're reading this then you're probably okay with that.
If there's anything I've missed, please leave a comment.
The Other IDEs page of the Android development documentation will fill in some of the simplifications I have made here and is recommended reading.
This Linux Magazine article is also worth looking through.