Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse setup for a single AOSP or CyanogenMod java application

Tags:

android

Preamble: I am a Java Android developer. I know the standard Android development flow.

I want to start developing for AOSP-CM. I follow the guide for import the whole Java source code in Eclipse, using the .classpath file provided with the source code. So I have a Java Project with all the source code, and I can browse and edit everything.

The next step is try to setup a single Android Project, for example the Phone Application, in order to use the ADT plugin feature like GUI graphical editor. I want to edit Phone sources, build within Eclipse and above all use Eclipse Debugger.

It is possible? Where I can find a guide or tutorial ?

like image 810
Sarbyn Avatar asked Nov 13 '22 11:11

Sarbyn


1 Answers

My final solution is:

  • Setup classpath

    cd /path/to/android/root

    cp development/ide/eclipse/.classpath .

    chmod u+w .classpath

  • Create a Java Project and select the CM (or Android AOSP) base folder instead of "Use default location".
Now, in eclipse, you can attach to the emulator, run DDMS and select the process that you want to debug (for example, com.android.calendar).
  • Run > Open Debug Dialog...
  • Right-click "Remote Java Application", select "New".
  • Pick a name, i.e. "android-debug" or anything you like.
  • Set the "Project" to your project name. Keep the Host set to "localhost", but change Port to 8700.
  • Click the "Debug" button and you should be all set.

Note that port 8700 is attached to whatever process is currently selected in the DDMS console, so you need to sure that DDMS has selected the process you want to debug.

like image 200
Sarbyn Avatar answered Nov 15 '22 13:11

Sarbyn