microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
231 stars 13 forks source link

[SUGGESTION] Add support for iOS USB debugging #1081

Open mauroa opened 6 months ago

mauroa commented 6 months ago

Describe the feature you'd like

Right now, the debugging of iOS physical devices is performed via TCP/IP under the hood, even if you connect your device via USB.

This has a side effect, which is that it's most likely that the first time you install your app, iOS will show a prompt asking you to allow finding and connecting devices to your local network. See the image below for reference:

image

This prompt will cause that the first time the user tries to debug an app, it will fail to connect the debugger and hit breakpoints. This has an easy workaround, which is the user needs to click Allow on the prompt and also it needs to launch the app again for debugging (F5). From the second time on, debugging will work fine.

To avoid this known issue, debugging via USB needs to be implemented, so we avoid TCP/IP and the iOS prompts.

There's a bug related to this: https://github.com/microsoft/vscode-dotnettools/issues/770

The bug will be closed as a known issue since there's a clear workaround, and we will use this suggestion ticket to implement the feature.

Alternatives considered

Click Allow on the prompt and launch the app again for debugging (F5). From the second time on, debugging will work fine.

Environment Information

shoter commented 2 months ago

I have 3 propositions that I think could be done alongside this user story. 1) Make Enable debugging flag set by default to true in debugging mode. It is insane that debugging is disabled in debugging mode by default. 2) Until this issue is fixed could we have Debug over WIFI flag set to true by default? It could be even removed until it is fixed. 3) For the future - could we have some warning/error showing up for value of settings that does not work correctly? Right now if user has disabled debugging over wifi then it would be nice if there would be some build message that his debugging experience might be... very bad.

marekdovjak commented 3 weeks ago

FYI: I have <key>NSBonjourServices</key> in my info.plist, and I was unable to trigger the local network access dialog (so unable to debug my app) until I removed it from Info.plist.