且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Unity调试Android设备

更新时间:2023-01-24 08:14:52

我今天也遇到问题。



您的前台步骤正确。问题是附加到进程。



在android设备上运行应用程序后,关闭unity但保持monodevelop,然后单击运行按钮(或菜单Run | Attach to Process)的monodevelop。现在您可以在对话框中看到设备列表。



它适用于我。我发现你提到的线程的解决方案



#15 manuelpeirone的回答


I'm having a hard time getting breakpoint debugging working for unity with and android device. I've tried with both visual studio code and monodevelop.

In android:

I have successfully done all the steps outlined here for getting android connected over wifi in tcpip mode: https://docs.unity3d.com/Manual/AttachingMonoDevelopDebuggerToAnAndroidDevice.html

In unity

In build settings I have "development build" and "script debugging" checked. When I build and run, it programs my device just fine over wifi.

For monodevelop

I try debugging with "attach to process" but it only finds the Unity Editor. Lots of people have the same problem:https://forum.unity3d.com/threads/attaching-monodevelop-debugger-to-an-android-device.245814/ Down at the bottom, people are figuring out that multicast settings were the issue. I have a linksys router, and I've ensured that security->filter multicast is unchecked. Is there anything else I have to do here to get multicast to work?

Since monodevelop wasn't working, I tried with vscode

For VS code

I added the plugin to an empty project as described here: https://code.visualstudio.com/Docs/runtimes/unity

When I try debugging with vscode I get the error "Could not find target name 'Android Player'. Is it running?"

I also wanted to see which processes I could select but when I try running "Unity Attach Debugger" from the command palette, I get this error: "command 'attach.attachToDebugger' not found"

Any help would be much appreciated!

I also got the problem today.

Your front steps are correct. Problem is "Attach to Process".

After app run on android device, close unity but keep monodevelop, then click the run button(or menu Run | Attach to Process) of monodevelop. Now u can see device list in the dialog.

It works for me. I found the solution from the thread u mentioned

#15 manuelpeirone's answer