# VS Debugger hangs on attach

**URL:** <https://forum.magicleap.cloud/t/vs-debugger-hangs-on-attach/548>\
**Category:** Unity Development\
**Created:** [August 10, 2022, 9:35pm UTC](https://forum.magicleap.cloud/t/vs-debugger-hangs-on-attach/548 "2022-08-10T21:35:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebelkin](https://avatars.discourse-cdn.com/v4/letter/e/ecb155/32.png) [@ebelkin](https://forum.magicleap.cloud/u/ebelkin)\
**Post date:** [August 10, 2022, 9:35pm UTC](https://forum.magicleap.cloud/t/vs-debugger-hangs-on-attach/548/1 "2022-08-10T21:35:47Z")

</div>

**Unity Editor version** : 2022.2.0a14.2006  
**ML2 OS version** : Build: B3E.220619.07-R.124 SDK Version 29  
**MLSDK version** : 0.53.1

"MagicLeap\_Examples" APK was created with Development build and Script Debugging option enabled. APK is deployed and the app is running. VS debugger sees the AndroidPlayer over the USB, but hangs on attach attempt. Tried VS 2019 Pro (16.11.11) and the latest VS 2022 Pro (17.2.6) with the same effect. Please advice if there is any known issues or workarounds?

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [August 11, 2022, 1:58pm UTC](https://forum.magicleap.cloud/t/vs-debugger-hangs-on-attach/548/2 "2022-08-11T13:58:20Z")

</div>

Hi Eugene

Are you able to attach visual studio to your Unity Editor? In visual studio please go to

- `Tools` ➝ `Options` ➝ `Tools for Unity`
- `Debugging` (section)
- Then Set “Preferred Android Sdk Root” appropriately for your project.
  - You’ll need to locate the the `AndroidPlayer\SDK` folder that you are pointing to inside of unity.

If this does not work, make sure that the Visual Studio plugin is up to date inside of the Unity Package manager. If this also does not work, I will file a bug with Unity, in the past developers have been able to get around a similar issue when debugging their Android applications by debugging over Wifi instead of USB.

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [April 17, 2024, 9:03pm UTC](https://forum.magicleap.cloud/t/vs-debugger-hangs-on-attach/548/3 "2024-04-17T21:03:46Z")

</div>


