Debug Service Tips?

34 views
Skip to first unread message

Kevin Miller

unread,
Sep 29, 2016, 3:39:45 PM9/29/16
to ioio-users
I did a IOIO project a year ago with the same phone and same IOIO and same laptop, same BT dongle for the IOIO, and I'm pretty sure I had no problems using the Android Studio 2.0(?) debugger to step through the IOIOService. Now I have AS 2.2 and probably some Android updates on the phone and Windows updates. Here is my setup:

Windows 7
Android Studio 2.2
Galaxy S3 with Android 4.4.2

DDMS is not seeing the phone either - I believe that worked before, too.

Does anyone have any tips for service debugging? Would IOIO bridge be helpful?

Thanks in advance. 

Ytai Ben-Tsvi

unread,
Sep 29, 2016, 5:11:50 PM9/29/16
to ioio-...@googlegroups.com

Are you able to debug any app using this setup? In other words, is this problem specific to IOIO apps?


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Kevin Miller

unread,
Sep 29, 2016, 7:03:39 PM9/29/16
to ioio-users
It is specific to Android services. I can debug activities in the same app, but breakpoints and Log commands inside the IOIOService are ignored. The app is a slight derivation of the HelloIoioService example.

Ytai Ben-Tsvi

unread,
Sep 29, 2016, 7:04:39 PM9/29/16
to ioio-...@googlegroups.com

Can you please try a non IOIO app?


On Sep 29, 2016 16:03, "Kevin Miller" <ksmil...@gmail.com> wrote:
It is specific to Android services. I can debug activities in the same app, but breakpoints and Log commands inside the IOIOService are ignored. The app is a slight derivation of the HelloIoioService example.

Kevin Miller

unread,
Oct 3, 2016, 11:16:13 PM10/3/16
to ioio-...@googlegroups.com
I've tried several non-ioio apps, and they do allow debugging in the looper of the service. The HelloIoIoService example is what I started with (which allows debugging in the looper), and then added a button on the Main to start and stop the blinking, and a second activity that is basically a copy of the main. I also added Messengers to both activities and a message handler in the IOIO service. The IOIO service broadcasts Intents about the status changes of the IOIO when it connects or disconnects. The main activity starts the service and then binds to it to send messages. When the second activity starts, it binds and sends a message requesting the LED status (blinking or off) and updates the button label based on the message reply. The activities unbind from the IOIOService in onDestroy().

You can find my little test/example here: https://github.com/ksmiller99/HelloIOIOServiceIPC . Comments and suggestions welcomed.

I used this HelloIOIOSericeIPC example as the base for a project about a year ago and I did not have any problems debugging it. If anyone can tell me why this won't break at breakpoints set in the setup() of the IOIOLooper and elsewhere, it'd be a great help.

Kevin

--
You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/KwiZlXZMf8A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ioio-users+unsubscribe@googlegroups.com.

Kevin Miller

unread,
Oct 4, 2016, 3:45:56 PM10/4/16
to ioio-users
Solved:
Removed '"android:process=":remote"' from the manifest <service> element. This was causing the service to run as a separate process. The debugger could be attached, but only after it was running and I need to debug the setup(). There may be ways to pause the remote process until the debugger attaches, but this works for me.
Reply all
Reply to author
Forward
0 new messages