Announcement

Collapse
No announcement yet.

Need tutorial for debugging on Android

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need tutorial for debugging on Android

    I've spent a couple weeks on this problem and haven't had success. I'm using VS2013 Professional and development targeting a Nexus 9 tablet running Android 5.0. Should I be using Linux or MacOS for Android development?

    My projects work fine when I run them, but I haven't been able to get a debugger attached to the running game successfully, so whenever I have a problem it's been a huge trial-and-error effort to fix. Using the suggested TADP2.0r8, I hit an illegal instruction right after connecting the debugger, but then the game runs fine with the debugger looking like it's attached, but breakpoints in my source code don't work. (That said, I am connected to the correct process; if I click 'pause process' I can look at the assembly of the various native threads and the process I am running pauses on the tablet)

    I've tried using latest TADP3.0 from NVidia's website, with slightly better luck (I was able to get some breakpoints in UE4 startup code to work), but my project crashes on startup using that build tool.

    I am not seeing the problems that Art_Oculus was seeing in this thread: https://forums.unrealengine.com/show...ing-on-Windows , but he seems to have gotten his problems fixed using an unreleased version of TADP2.

    I'd like some help documenting the process to get a build with a working debugger for UE4 Android on Windows.
    Last edited by ryani; 01-27-2015, 01:19 AM.

    #2
    I want this too!
    WIP Save the princess !
    https://twitter.com/stp_the_game

    Comment


      #4
      I don't see anything on the tools/debugging page that talks about gdb or any other debugger, let alone integrating a debugger into an IDE as NVidia NSight (part of TADP2 and TADP3) claims to be able to do.

      And logcat is helpful for printf debugging but that's pretty weak compared to the full toolset available debugging on Windows. I haven't looked at AVD / emulated devices but my guess is that they just run on the host JDK and won't work with NDK native ARM code which UE4 relies on.

      Comment


        #5
        the debugging page is all about debugging lol
        You need a JDWP-compliant debugger if you want to be able to do things such as step through code, view variable values, and pause execution of an application
        i suppose you found this page too?
        http://docs.nvidia.com/gameworks/ind...htm#kanchor241

        dont bite, only trying to help

        edit:
        i havnt tried to debug a ue4 android project yet, only pure code based projects a few years back using logcat.
        after some searching i see there is no mention in ue4 docs, so it probably needs something there you are right.
        unless you are looking for something device specific couldnt you use the mobile previewer or even play in editor to catch those bugs?
        Last edited by tegleg; 01-28-2015, 06:56 AM.
        tegleg.co.uk - indie electronic music label
        Android + HTML5 WIP Physics Game
        PC Games - Android Apps

        Comment


          #6
          Originally posted by tegleg View Post
          edit:
          i havnt tried to debug a ue4 android project yet, only pure code based projects a few years back using logcat.
          after some searching i see there is no mention in ue4 docs, so it probably needs something there you are right.
          unless you are looking for something device specific couldnt you use the mobile previewer or even play in editor to catch those bugs?
          Generally yes I prefer to work on PC / mobile preview, but even in just a couple months of use I've run into device-only problems; recently I had a crash on startup that only showed up on device, and was unable to get any useful data out of the logcat logs which had me wishing for a debugger. I eventually resorted to binary searching through objects in the scene, deleting stuff until it worked, then subdividing until I found the problem objects. It took several hours to find that one of the static mesh objects had a strange material on it that was causing UE4 to crash. And this was in a blueprint-only project made by my artist--I can't imagine how difficult it would be if the problem was in some C++ code I had written!

          So while for day-to-day development, mobile preview is good enough, engineers really need debugging support for when things go wrong.

          Thanks for the link to the Tegra documentation page, I had been looking for something like that on NVidia's site but hadn't had luck yet. It's tricky because UE4 has its own build system separate from Visual Studio, so I'm not sure how/if they interact. The section on debugging a separate APK with it's own project is new to me though, and seems like a promising path to try to end-around UE4s default project settings which don't seem to work properly.

          I apologize if I came off as a bit cross--I've spent several days pushing on different avenues to get a native debugger up and running and it's starting to wear on me, I think. Hopefully there are Epic devs working on this problem who can give some guidance!

          EDIT: I also suspect part of the problem is I'm on the bleeding edge of Android Lollipop, when I talked to NVidia's Tegra dev he said it's probably the biggest change in Android history.
          Last edited by ryani; 01-28-2015, 02:25 PM.

          Comment


            #7
            Originally posted by ryani View Post
            I eventually resorted to binary searching through objects in the scene, deleting stuff until it worked, then subdividing until I found the problem objects. It took several hours to find that one of the static mesh objects had a strange material on it that was causing UE4 to crash. And this was in a blueprint-only project made by my artist--I can't imagine how difficult it would be if the problem was in some C++ code I had written!
            Hi ryani, I agree it's very painful and lack of standarization on debuggers doesn't help; for your particular issue, it'd be awesome if you could share what was the issue so we can try to trap it in the mobile preview.

            Comment


              #8
              Originally posted by RCaloca View Post
              Hi ryani, I agree it's very painful and lack of standarization on debuggers doesn't help; for your particular issue, it'd be awesome if you could share what was the issue so we can try to trap it in the mobile preview.
              Sure, I should have some time later this week to grab an old version of the map and strip it down to the problem object for you. Would love to get someone at Epic do a quick investigation of upgrading UE4 to run on TADP3.0!

              Comment


                #9
                Need tutorial for debugging on Android

                Hey guys, thanks you for sharing cheers

                Comment


                  #10
                  did anybody find anyway to debug c++ code?
                  Need help or work to be done?
                  Contact Info

                  Comment


                    #11
                    I have added adb to the PATH variable (any version of SDK/Code/Androidworks). I then use adb logcat via command line.
                    If you are on linux you can tail(I think that's the corerct command- can't recall) with the logfile at the device.
                    Github - YouTube - Unreal Slackers - KITATUS

                    Comment

                    Working...
                    X