Search Unity

Debugging on Android Device - not hitting breakpoint

Discussion in 'Android' started by proto_monkey, Oct 11, 2015.

  1. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    I am having a problem using the mono develop debugger with an Android device - Asus ZenPad with lollipop 5.0

    I have seen some threads where others have had trouble attaching to the device etc, but that part is working just fine. I am able to attach and the app is running just fine on the device. However, when I place a breakpoint the app freezes as if it has hit the breakpoint, but the breakpoint is never highlighted and I'm not able to step through the code from there.

    If I then remove the breakpoint, the app will unfreeze and continue running normally. Is there something I am missing process or settings wise ?

    I have Development Build and Script Debugging checked in build settings.

    On the device I have USB debugging enabled. And have tried without that enabled - thinking that maybe i need to use wifi ?!!? Same thing occurs both ways.

    Is it possibly an adb setting ? I have followed all the advice I have seen in other posts, and I have no problem attaching process as others have. My device shows up with correct IP etc.

    I am building on a macbook pro with el capitan version of OSX.

    Any help or ideas that anyone can suggest would be greatly appreciated at this point.
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    AFAIK, you can only debug using WIFI: your device and your machine running the debugger must be on the same LAN in order for debugging to work.

    If you're seeing the device in MonoDevelop it probably means that this is what's happening (is the device listed with an IP next to it ?)

    I have no idea why it freezes but you can try 2 things:

     
  3. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    Thanks for the response. Yes, my IP is showing up just fine.

    Tried the new mono develop and get the exact same outcome. I can literally pause/unpause the game on the device by just dropping a breakpoint in the Update method. It just doesn't allow me to step through , check variables etc.

    I don't have another Android device to test on at this time.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    does that produce the same results, no matter where you place your breakpoints ?
     
  5. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    Yes, I've tried putting the breakpoints in different places outside of the Update, same behavior in all cases.

    It just pauses as if execution has halted, but the typical breakpoint abilities are not available. No highlighting of the breakpoint line etc.
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I'm trying to come up with other suggestions... the ZenPad is an Intel based device (it has an x86 based CPU), right ?

    Are you building your game using ARM, or FAT (ARM + x86) ?

    I know that some devices offer a translation layer (called libhoudini) that allows ARM apps to execute on x86 devices. Maybe (just a wild guess), if that is the case here, there may be issues with attempting to debug the code there. Just a wild guess, but that's what i have for now :(
     
  7. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    Yes, I am building with the device filter set as Fat(ARMv 7 + x 86)

    ZenPad is intel based. I have been wondering if that might be the issue potentially. If so, was hoping someone could say definitively. (it would seem to be something that could be said definitively if that was the case)

    If that is the issue, what a pain in the.... haha

    This thread http://forum.unity3d.com/threads/unity-for-intel-atom-cpus.206787/

    has this blurb :

    "Your Unity app will run on an Intel ATOM device. You can't use USB debugging directly from Unity though. To debug on an Intel ATOM device, you have to make a build of the app, and then transfer the app to the device manually. You can do this many ways: ADB transfer, Bluetooth, dragging the app into the storage of your device and use the device's File Manager to install the app, there are probably also tons of file sharing apps on the Play Store that could be used.

    So, it's certainly possible to use an ATOM device to develop Unity apps."


    I will try this method instead of build and run from the Unity Editor and see if that makes a difference.
     
  8. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    I've tried a x86 specific build and copying/installing on the device. Same exact behavior when trying to debug.

    I guess my next step should be trying this on a non intel based android device.

    But if anyone has been successful at actually debugging on an intel based device, or a ZenPad specifically, I'd definitely like to hear from you!
     
  9. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    Someone from Unity? confirm that debugging should work or not work with an intel based android device ?
     
  10. proto_monkey

    proto_monkey

    Joined:
    Jun 7, 2015
    Posts:
    18
    Ok, I was able to try debugging on another Android tablet with an ARM processor that indeed works.

    So the question is now -> Is it possible to debug with an Intel based android device ?

    By debug , I mean being able to step through code and check variables etc -- not simply logging and all the brutality that goes with that.
     
  11. Giascar

    Giascar

    Joined:
    Mar 31, 2015
    Posts:
    1
    Hi, same problem here: I've a ZenFone 2 based on Intel Atom.
    I tried to build in FAT, x86 and ARM with same result of proto_monkey.

    Debugger runs fine as usual with other devices based on ARM processor.