1

I'm no longer able to debug my Cordova app on the iOS simulator. I get the dreaded "We're unable to find the app ... you're trying to debug." error. I've tried all the troubleshooting steps, but nothing has worked so far.

I should note that this was working just fine. I was able to debug my app multiple times, with no issues, and then suddenly this error started, and nothing I've tried has fixed it.

Interestingly, the actual build logs in Visual Studio make it look like everything went fine:

Requesting debug on remote iOS device for buildNumber 6805 on server https://<redacted>:3000/cordova... Debugging - Successfully Debugging on the device {webDebugPort=9221}

Anyone have any ideas?

UPDATE 1 Tried this on my local OS X device, too, and got a similar result. Here are the actual build logs:

Unable to attach to debug. Check that http://Matts-Mac-mini:9221 is accessible. We were unable to find the app you’re trying to debug. Check that the device is connected, awake, and unlocked. Also, make sure it has Web Inspector enabled. ------ Cordova tools 6.1.1 already installed. Requesting emulate on iOS Simulator for buildNumber 522 on server http://Matts-Mac-mini:3000/cordova... Emulated - Successfully sent to ios Simulator ------ Cordova tools 6.1.1 already installed. Requesting debug on remote iOS device for buildNumber 522 on server http://Matts-Mac-mini:3000/cordova... Debugging - Successfully Debugging on the device {webDebugPort=9221}

It looks like things fail, but then the later messages (which appear right away) make it look like things worked. And the app is indeed running in the simulator on my Mac.

Matt Honeycutt
  • 1,009
  • 11
  • 16
  • Try opening the safari Web Inspector. See [this link](http://taco.visualstudio.com/en-us/docs/ios-guide/#safari). – Elvis Xia - MSFT Jul 25 '16 at 02:02
  • Already did that. Web Inspector was already enabled in the simulator. I tried disabling it, debugging the app (which failed as expected), then re-enabling it. Same result as before. – Matt Honeycutt Jul 26 '16 at 13:21
  • I found a similar case [here](http://stackoverflow.com/questions/36803349/why-is-visual-studio-taco-unable-to-find-the-app-i-am-trying-to-debug). I think you can try the steps of Jordan Matthiesen's answer to change the timeout. – Elvis Xia - MSFT Jul 28 '16 at 00:54
  • Already tried that, too. Changing the timeout has no effect. Strangely, even if I attempt to start the project without debugging, Visual Studio still freezes for a good 30 seconds or so after the build completes. – Matt Honeycutt Jul 29 '16 at 01:20
  • Does the machine running the iOS simulator have more than one simulator running (as another user, for example)? Also check to see if there is an `ios_webkit_debug_proxy` program running. If this is happening with exactly one iOS simulator running, and no `ios_webkit_debug_proxy` instances prior to attempting to f5, then is your app a hosted app, by which I mean do you host your app online rather than bundling the html in the app itself? – Laguana Aug 03 '16 at 19:43
  • I was testing this using MacinCloud, so it is quite possible that there were other simulators running as different users. Do the VS TACO tools not support debugging in that scenario? – Matt Honeycutt Aug 16 '16 at 13:39
  • It is a difficult scenario to support. To debug the iOS simulator, we use a tool `ios-webkit-debug-proxy`, which connects to "The simulator". If there are multiple simulators open at once (typically through multiple users) then "the simulator" it connects to may not be the one you expect, and so your app may not be running in it leading to this error. – Laguana Aug 16 '16 at 16:58

1 Answers1

2

After the discussion in the comments, I believe that the issue here is using a shared machine for debugging. If there are multiple iOS simulators running on a machine at the same time (Typically because there are multiple users connected to the machine each running their own simulator) then remotebuild cannot guarantee that you connect to the correct simulator. This is because we use ios-webkit-debug-proxy which assumes that only a single iOS simulator exists, and doesn't expose a way to restrict which one it connects to.

If you are trying to debug an app in the simulator and there is another user with a different simulator, you may connect to the wrong simulator where your app will not be running, and that can cause the error that you see.

Laguana
  • 161
  • 3
  • Sorry for just now getting back to this. I am encountering the exact same error using a dedicated Mac. There are no other instances of the simulator, but I still get the same failure every time. Any suggestions? – Matt Honeycutt Sep 20 '16 at 03:27