- Home /
Can't Attach Debugger to Android Build
I have successfully connected my android build to the unity console. I am able to see all logs from the device in the unity editor. However, I am still unable to attach my debugger to the process - VS or monodevelop. It simply cannot find the process. How can I do this?
I tried making a very basic project - just a camera and as script that repeatedly says hello. The unity console sees the "hello"s but monodevelop cannot find the process.
https://forum.unity.com/threads/attaching-monodevelop-debugger-to-an-android-device.245814/
Seems like unity doesn't really feel like answering this question...
Answer by rodeowild · May 24, 2018 at 08:33 PM
1) attach your device to your computer with a USB. You may have to disable your firewall 2) start ADB in your command prompt/terminal. The comand for this is adb tcpip 5555
3) start logcat. The command is adb logcat
. This will print all the ADB output to the terminal 4) start the app on android. 5) Now find IP and port associated with your device. The IP is the IP of your phone. To find the port, look for the line --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56052
in the logcat output. 6) attach visual studio to this IP and port. to do this go to the menu in visual studio. click Debug > Attach Unity Debugger. Click "Input IP" (bottom left of the pop up window). Input the IP and port you found in the last step. It will take about 30 seconds to attach, but it should then hit any breakpoints you set.
Note that the port will be different every time. Thank you Stackoverflow
Thanks you so much! Couldn't connect to my device. Needed the correct Port :)
Answer by mc_fragezeichen · Feb 11 at 11:04 AM
I thought that connecting the phone via USB was enough (had the phone in flight mode). But apparently I have to enable adb over tcip as well in order to perform debugging via Visual Studio