Cannot Debug on Android Device from Visual Studio

Hi there

Just came here to post a solution to this issue for anybody else with this issue in future.

If Visual Studio does not list the AndroidPlayer when you select Debug > Attach Unity Debugger, then perhaps this will help.

In VS, go to Tools > Options and set the SDK Path manually:

You can find the path from “Unity > Edit > Preferences > External Tools > Android SDK…”

My path was blank, which should work but this seems like a bug or a confusion due to a previously installed SDK (before it was bundled with Unity).

Hope this helps somebody.

21 Likes

Are you using a emulator or a connected device in this case? I would love to have a debugger attached to a connected device but I have not found a way to do it.

Edit : Never mind I did not have the correct build config. This was very helpful Thanks!

1 Like

This would have saved me so much time in the past! This really should be more accessible knowledge!

2 Likes

This should be added in ms documentation.

1 Like

I spent so much time trying to figure out why AndroidPlayer wasn’t showing and this was it! Thank you so much!

1 Like

This is great answer. Worked right away. Thanks a lot, saved me.

1 Like

You’re a legend!

1 Like

brilliant!

1 Like

Thank you so mush! I spend whole day trying to resolve this problem!

1 Like

Thanks so much, helped alot!

1 Like

Great, this solved my problem.
Unity 2022.3.15f1

1 Like