question

PatLong-0499 avatar image
1 Vote"
PatLong-0499 asked PhilSeeman-9261 edited

Xamarin iOS app very slow when debugger attached

For the last week my Xamarin Forms app is running incredibly slowly when the debugger is attached. To quantify what I mean by "slow"

  • Scrolling a TableView with 20 fixed TableCells takes upto 20 seconds to respond to the scroll

  • Moving from Page to Page takes 45 seconds

If I disconnect the debugger (By pressing stop button) and run the same deployed app, on the same device it works and performs as expected. I have tried debugging over WiFi and with a direct cable to the Mac build machine.

Looking at the scrolling example I see nothing in the debug window (or any of the Xamarin panes) other than

 Thread finished: <Thread Pool> #278
 Thread finished: <Thread Pool> #270
 Thread finished: <Thread Pool> #291
 Thread finished: <Thread Pool> #305
 Thread finished: <Thread Pool> #288
 Thread finished: <Thread Pool> #271
 Thread finished: <Thread Pool> #285
 Thread finished: <Thread Pool> #272
 Thread finished: <Thread Pool> #259
 Thread finished: <Thread Pool> #251
 Thread finished: <Thread Pool> #249
 Thread finished: <Thread Pool> #269
 Thread finished: <Thread Pool> #248
 Thread finished: <Thread Pool> #245
 Thread finished: <Thread Pool> #267
 The thread 0x116 has exited with code 0 (0x0).
 The thread 0x10e has exited with code 0 (0x0).
 The thread 0x123 has exited with code 0 (0x0).
 The thread 0x131 has exited with code 0 (0x0).
 The thread 0x120 has exited with code 0 (0x0).
 The thread 0x10f has exited with code 0 (0x0).
 The thread 0x11d has exited with code 0 (0x0).
 The thread 0x110 has exited with code 0 (0x0).
 The thread 0x103 has exited with code 0 (0x0).
 The thread 0xfb has exited with code 0 (0x0).
 The thread 0xf9 has exited with code 0 (0x0).
 The thread 0x10d has exited with code 0 (0x0).
 The thread 0xf8 has exited with code 0 (0x0).
 The thread 0xf5 has exited with code 0 (0x0).
 The thread 0x10b has exited with code 0 (0x0).
 Thread started: <Thread Pool> #313
 Thread started: <Thread Pool> #314
 Thread started: <Thread Pool> #315



Visual Studio is running on my Windows 10 laptop

VS 2019 on Windows 16.11.7 connected to Macbook pro with Xcode 13.1. I have restarted the Windows machine, the mac and the iPhone 11 device

Any idea what to look for?


dotnet-xamarin
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

exited with code 0 means there was no error. You could try to update VS2019 to VS2022, VS2022 also contains the support for XCode 13.2.

0 Votes 0 ·

I tried the upgrade to 16.11.10 yesterday and that made no difference at all. Upgrading to VS2022 is a considerable upheaval considering the likely requirement to then upgrade XCode.

Can you honestly say the Xamarin iOS expereince is going to be any better in 2022?

Do you have any idea what might be causing this current issue?

0 Votes 0 ·

3 hours later after upgrading to VS 2022 and XCode 13.2.1 and I am exactly where I was beforehand. Come on there must be a better suggestion

0 Votes 0 ·

I found this "Feedback" from 2019 that suggested switching the Link options to Framework SDKs only and that has meaant i can debug in iOS but this is really just a workaround.

https://developercommunity.visualstudio.com/t/debugging-xamarin-ios-application-is-very-slow-vs/676129#T-N713077

0 Votes 0 ·

Try to Enable incremental builds and Enable device-specific builds which locates at Properties ->iOS Build. I'm not clear about your TableView, you could refer to Optimize ListView performance. In addition, if you create a new project via VS2022, it still runs very slowly on debug mode?


0 Votes 0 ·

I have the exact same issue; my VS 2022 instance is running verrrry slowly when debugging on a local iOS device.

The workaround of switching to "Link Framework SDKs Only" works for me, also - things then run at normal speed.

@WenyanZhang-MSFT it's a runtime issue; I don't see how changing those build properties would affect the running performance? The issue is not the build time.

0 Votes 0 ·

0 Answers