Xamarin ios waiting for debugger to connect on port 10000 via usb
Tags: debug, showdev, mobile, csharp
Published: 2020-06-09 10:57:58

---
title: Xamarin ios waiting for debugger to connect on port 10000 via usb
published: true
description: This short post explains how to fix the “xamarin ios waiting for debugger to connect on port 10000 via usb” issue and get your debugger working again.
tags: debug,showdev,mobile,csharp
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0ayupqqn4tk2tzxrzt7i.jpg
---

This short post explains how to fix the “xamarin ios waiting for debugger to connect on port 10000 via usb” issue and get your debugger working again.

Xamarin ios waiting for debugger to connect on port 10000 via usb
### On-device Debugging Wanted

Every mobile developer knows that you need to run and debug your app on an actual device to make sure that things are working as expected.

Wether it is the Anroid Emulator or the iOS simulator; they can only go so far on simulating the actual target environment of physical devices.

And when things DO go wrong (your solution rarely compiles and runs without any mistake) it really helps when you can debug on your device.

When you’ve grabbed your favorite drink and spun up the debug session, it can be extremely frustrating when the following happens with your Xamarin iOS project:

* project building…. finished 😁

* deploying to device …. 10..20..30………..100% 👌🏻

* The top status bar is showing you the following message:

    **xamarin ios waiting for debugger to connect on port 10000 via usb**

* 😅 okay, i’ll wait a few seconds

* <Nothing changes> 🥴

* you wait for a minute… status remaining the same: it appears to be stuck 

![xamarin ios waiting for debugger to connect on port 10000 via usb is not what you want to get stuck at after you deployed](https://dev-to-uploads.s3.amazonaws.com/i/63944otr5ggoy5e0p9p3.gif)

As it appears, the debugger can’t hook up with your iOS device, and won’t let you step through your code. 

This bug seems to be occurring when you’re trying to debug via USB as well. Obviously, the error will then show up as follows:

    **xamarin ios waiting for debugger to connect on port 10000 via wifi**

Meanwhile, on the device, you can use the app as expected but debugging is not possible.

### Fixing the Infinite Wait

Somehow, this issue is caused by the build on the device not properly reacting to the message that Visual Studio is sending over on the default debugging port (which is port 10000).

The app lanches, but things are not communicating conform expectations of the debugging protocol.

In order to fix this from happening again, here are the basic steps that you should follow:

1. Remove the app from your iOS device

1. In Visual Studio For Mac go and clean your solution (Build > Clean All)

1. Right click on your iOS project and select “Reveal in Finder”, and delete the ***bin** *and ***obj*** directories

1. Close Visual Studio entirely

1. Restart your iOS device (it depends on your device how you need to do this, check [Apple’s instructions](https://support.apple.com/en-gb/HT201559) if you don’t know how to do it)

1. While your phone is rebooting, you can spin up Visual Studio For Mac, open up your solution and rebuild your Xamarin.iOS project

1. As soon as your phone is ready and loaded, Build and Run your project on the device

1. This time, the deployed application instance should hook up nicely with Visual Studio for Mac once again

1. Debug and do your thing 🎉

### Still Stuck?

The steps I mention in this post assume you’re running a project that is using the default debugging configuration for Xamarin.iOS projects. 

If you’re still running into issues, check:

*  the debug settings on your project via: Right click on your iOS project > Options >iOS Debug. Enable debugging should be checked for your configuration (debug > iPhone)

* check and see that you are actually trying to run the debug version (not the release)

* check that the debug information is set to “Full” for your projecrt via: Right click on your iOS project > Options > Compiler

![Check all debug settings if the "xamarin ios waiting for debugger to connect on port 10000 via usb" error keeps bugging you](https://dev-to-uploads.s3.amazonaws.com/i/1cigyty8kv9lu49ut8zs.jpg)
<figcaption>Photo by Glenn Carstens-Peters on Unsplash</figcaption>

### The End

I hope these instructions saved you some time defeating the “Xamarin iOS waiting for debugger to connect on port 10000 via USB” message.

At least the origin for this bug (for once) isn’t because you:

**a)** set up something wrong or 
**b)** put an awful and/or weird line of code in your project

These things tend to consume way too much time because we coders often tend to think it’s definitely a or b.

Don’t loose your spirits and keep up with building another awesome solution that provides value!

Code hard, [Ship harder](https:www.shipharder.com)!

This post is also published [on Medium](https://medium.com/@EeKayOnline/xamarin-ios-waiting-for-debugger-to-connect-on-port-10000-via-usb-cfc5e5577720)