0

I have been learning Android under windows 7 with netbeans. I used netbeans IDE for opening a android project, debug, run. For making any change in the code i used gvim. Now i have changed my OS with ubuntu LTS (10.04). I need to depend only on command line compilation due to some reasons. So i can not have either eclipse or netbeans.

I have installed everything correctly. When I give Android in the command line the emulator shows up..I have created hello world with command line. I followed these links..

http://developer.android.com/guide/developing/projects/projects-cmdline.html http://developer.android.com/guide/developing/building/building-cmdline.html

I install the app (.apk) and run through emulator. It is ruing for the first time. But when i change any code then its not as easy like the netbeans IDE button clicks like "build and run". When I run again (command: ant debug / adb install .apk) it says that it has been already install. I also wanted to run the sample programs (comes along with android download) through cmd line and run it through emulator. But when I give my command "ant debug" no build file found because those sample have only /res and /src with main fist xml.

Is there any easy way to compile and run programs with command line? For a very simple change to see the output do i have to go through all these long command line process?

ingsaurabh
  • 15,249
  • 7
  • 52
  • 81

4 Answers4

0

This is all a bit outdated, as nowadays you use gradle. If you still use ant, you can try this instead of your commands ("ant debug / adb install .apk")

ant debug install

This combines both of your commands and also does a reinstall if the package already exists.

If you use gradle, you can do

gradle installDebug

(this is from a question about how to do this on gradle. Upvote there too, if you use this)

Community
  • 1
  • 1
serv-inc
  • 35,772
  • 9
  • 166
  • 188
0

There is nothing wrong, you need read help of adb command adb install -r your-apk

pinxue
  • 1,736
  • 12
  • 17
0

You should be able to generate a build.xml and use ant to compile your code following the instructions here. You can dig deeper in those links to learn more about commandline builds. Then you can load it on handset using adb commands.

omermuhammed
  • 7,365
  • 4
  • 27
  • 40
0

Try running this from your project folder.

android update project --path .
blessanm86
  • 31,439
  • 14
  • 68
  • 79