Debugging Android apps via Netbeans

1,392 views
Skip to first unread message

Farrukh Najmi

unread,
Jun 17, 2011, 9:15:45 AM6/17/11
to maven-androi...@googlegroups.com

I am using Netbeans, maven-android-plugin to develop my Android app. I have not had much luck getting the debugger to work with an app deployed on a device (Virtual;Box Andorid VM in my case). Is any one else using Netbeans? If so, perhaps we can colaborate and donate some Netbeans specific docs to the project. Please let me know if you are able to help. Thanks.

--
Regards,
Farrukh

Farrukh Najmi

unread,
Jun 17, 2011, 10:06:57 AM6/17/11
to maven-androi...@googlegroups.com

I was able to get debugging working just fine. What I did not realize is that I must have the app running before I can connect to it using the app's debug port. Doh!

Here is what I did:

  • Start the app on device
  • Run $ANDROID_HOME/tools/ddms manually in background. It brings up this useful Dalvik Debug Monitor
  • Lookup my app in ddms and get its debug port
  • In NB 6.9.1 do: Debug / Attach Debugger and specify the port looked up in ddms (leave rest as defaults). Click OK
The app is now being debugged!
--
Regards,
Farrukh

Fabrizio Giudici

unread,
Jun 17, 2011, 11:04:12 AM6/17/11
to maven-androi...@googlegroups.com, Farrukh Najmi
On 06/17/2011 04:06 PM, Farrukh Najmi wrote:
>
> I was able to get debugging working just fine. What I did not realize
> is that I must have the app running before I can connect to it using
> the app's debug port. Doh!
>
> Here is what I did:
>
> * Start the app on device
> * Run $ANDROID_HOME/tools/ddms manually in background. It brings

> up this useful Dalvik Debug Monitor
> * Lookup my app in ddms and get its debug port
> * In NB 6.9.1 do: Debug / Attach Debugger and specify the port

> looked up in ddms (leave rest as defaults). Click OK
>
> The app is now being debugged!
>
That's cool. Farrukh, would you mind writing a very short tutorial to be
posted at netbeans.dzone.com? I must say I'm using NetBeans and the
Maven Android plugin since one year, but I never tried the debugger.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it

Martin Krischik

unread,
Jun 20, 2011, 1:37:10 AM6/20/11
to Maven Android Developers
On Jun 17, 3:15 pm, Farrukh Najmi <farrukh.n...@gmail.com> wrote:

> I am using Netbeans, maven-android-plugin to develop my Android app. I have
> not had much luck getting the debugger to work with an app deployed on a
> device (Virtual;Box Andorid VM in my case). Is any one else using Netbeans?

1) The DDMS debugging bridge must be started.
2) You need to start the app with debug on (adb shell am start -D …)
3) You need to use the remote debugger on port 8700

> If so, perhaps we can colaborate and donate some Netbeans specific docs to
> the project. Please let me know if you are able to help. Thanks.

Actually debugging is the reason why I switched InteliiJ IDEA where
the remote debugger works better then with Netbeans.

Martin

Fabrizio Giudici

unread,
Jun 20, 2011, 3:46:17 AM6/20/11
to maven-androi...@googlegroups.com, Farrukh Najmi
On 06/17/2011 05:04 PM, Fabrizio Giudici wrote:
>
> That's cool. Farrukh, would you mind writing a very short tutorial to
> be posted at netbeans.dzone.com? I must say I'm using NetBeans and the
> Maven Android plugin since one year, but I never tried the debugger.
>
FYI Farrukh posted at:

http://netbeans.dzone.com/nb-developing-android-apps

Manfred Moser

unread,
Jun 20, 2011, 11:20:23 AM6/20/11
to maven-androi...@googlegroups.com, Farrukh Najmi
> On 06/17/2011 05:04 PM, Fabrizio Giudici wrote:
>>
>> That's cool. Farrukh, would you mind writing a very short tutorial to
>> be posted at netbeans.dzone.com? I must say I'm using NetBeans and the
>> Maven Android plugin since one year, but I never tried the debugger.
>>
> FYI Farrukh posted at:
>
> http://netbeans.dzone.com/nb-developing-android-apps

Great article. Thanks Farrukh. I added a link to the wiki.

http://code.google.com/p/maven-android-plugin/wiki/LinksBlogsAndMore

manfred

Reply all
Reply to author
Forward
0 new messages