Attach to process never shows my device
I've followed the steps outlined at http://docs.unity3d.com/Manual/AttachingMonoDevelopDebuggerToAnAndroidDevice.html
I become blocked on the final step to attach to the process, because all I see in the modal is the option to connect to unity. I've properly setup the tcpip connection and the device shows up when I use adb devices.
Development Build and Script debugging are enabled for my builds. I've tried restarting my machine, the device, switching from MTP to PTP, different wifi networks and absolutely nothing helps. I am on mac osx, trying to connect to a samsung s6, using unity 5.3.2p4 and monodevelop 5.9.6.
How is it possible for adb to see the device but unity cannot? This has eaten my entire day and is very frustrating...
I am also stuck with the same problem, as are many others. You can read more about it on this thread: http://forum.unity3d.com/threads/attaching-monodevelop-debugger-to-an-android-device.245814/. This thread is 22 months old with no solutions forthco$$anonymous$$g from the Unity $$anonymous$$m. As with the others, I've tried the prescribed steps and am stuck on the "Attach to Process" step - my device NEVER appears in the list - only Unity Editor is listed. ADB can see and connect just fine, and "$ adb logcat" works fine. At this point I am extremely frustrated and unable to continue with my project. $$anonymous$$y application works fine when running in the Editor or as a standalone $$anonymous$$ac OS X application. It does not work in the Gear VR environment, and now I have no way do debug the problem. I'm beginning to wonder why I spent $3000 on Unity Pro 5.3 and Android Pro when I'm left dead in the water.
I am running Unity 5.3.1f1. I have tried 2 devices with the same results: Galaxy Note 4 running 5.0.1 and a Galaxy Note 5 running 5.1.1
I am now able to see the device in the list (and connect), but only if I uncheck "Wait for debugger" in Gear VR Service settings on device. This makes connecting useless because I can't set breakpoints in any of the Start() methods.
Answer by naviln · Dec 27, 2017 at 06:12 AM
I know this is old, but I had to spend some time debugging on a android tablet, and read through a whole bunch of these posts no to avail. I finally got it going, just sharing in case it helps someone!
The usual stuff, follow the steps here: https://docs.unity3d.com/Manual/AttachingMonoDevelopDebuggerToAnAndroidDevice.html
Make sure to disable your whatever antivirus you are using, in my case it was Window Defender, (or disable your firewall temporarily if it still gives you trouble.)
Next, run your app on your device/tablet. Then, in the last step where it says to use attach to process - NO, don't do that! (I'm using Visual Studio 2015 btw.)
Instead, in the Debug menu dropdown, choose "Attach Unity Debugger".
Here is a picture:
In the next window, I found my samsung tablet ready for attaching. I was able to step into my C# classes and debug.
Hopefully that helps someone out there!
Cheers
Navil
This did the trick for me. Thank you! Works with Visual Studio 2017 Community as well.
Hi @naviln, This really helped me but I have a quick question. I am connected correctly and got all the way up to this point and see my Android device in the "Attach Unity Debugger" dialogue (screen shot below). but then when I click on the device it does not allow me to step into my C# classes and actually debug it seems to jump out like the connection to the device did not work. I then input manually with the "Input IP" button at bottom with the IP and :5555 port and the did not work either. I can get debugs on Logcat and all that as well. am I missing somthing? For you, It worked at the default port that Visual Studio gave you(56159)? Thanks for your help!
Hey buddy,
I can't see your screenshot.
That's a strange one, not sure why that would happen. Did you set a breakpoint in your code? Are you sure that USB debugging is enabled on your android? Can you try another android device? And maybe a different wifi network as well
Your answer
Follow this Question
Related Questions
Null Reference Exception only when using debugger 0 Answers
Monodevelop / VS not listing iOS device 0 Answers
breakpoints stopped working 1 Answer
how can i attach visual studio debug under android 2 Answers
Problems debugging with Monodevelop 0 Answers