MonoDevelop Debugging of Android Player: How to Attach to Process of Android Device/Application

Unity v4.1.2 Pro with Android support.
Android SDK v4.2.2 Jelly Bean.
MonoDevelop v2.8.2 (Unity)

  1. Can successfully build, run, debug Unity Editor

  2. Can successfully connect to my various Android Devices ( GalaxyNexus, Nexus7, Nexus10 ) via USB debugging & ADB.

  3. Can successfully connect and run Unity Profiling via USB debugging & ADB.

  4. Can successfully Build & Run a test.apk on each device.

  5. CANNOT attach to the process in MonoDevelop to debug. Starting MonoDevelop and opening “Attach to Process” dialog, shows no “Android*” device/application process to attach to. Only see “Unity Editor”.

  6. Note*, can successfully use Unity Remote as well via USB Debugging & ADB.

Is it only possible to debug Android applications via WiFi?

Any insight would be much appreciated.

I contacted Unity Technical Support. Apparently, Unity Script Debugging on Android with MonoDevelop is only supported via WiFi. It is not possible via USB Cable.

  1. Open TCPIP port for ADB WiFi serving

>adb tcpip 55555
2. Connect to Android device via WiFi

*>adb connect *
3. Android device should then appear:

  • Unity Profiler → Active Profiler as AndroidPlayer
  • MonoDevelop → Attach to Process as AndroidPlayer

You have to allow MonoDevelop to communicate through Windows Firewall. Go to Control Panel\System and Security\Windows Firewall\Allowed Programs and change the settings for MonoDevelop. The device will appear right away if the rest of the steps are completed successfully.