Bug 27764 - Unable to debug an iOS project over Wifi
Summary: Unable to debug an iOS project over Wifi
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 5.7
Hardware: PC Mac OS
: Normal normal
Target Milestone: master
Assignee: Jeffrey Stedfast
URL:
: 26668 ()
Depends on:
Blocks:
 
Reported: 2015-03-09 05:53 UTC by Prashant Cholachagudda
Modified: 2015-03-12 06:45 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Prashant Cholachagudda 2015-03-09 05:53:18 UTC
Unable to debug an app over the WiFi connection. The Application Output show debugger is waiting to connect, but the connection never happens

# Steps to reproduce
Create an iOS project in Xamarin Studio, Open Preferences and under Projects -> iOS, select “Debug iOS devices over WiFi instead of over USB” and click OK. 
Then select Debug in the configuration dropdown, and then I select an iOS device under the Device list. 
From there start the debugger session. The app will build, deploy to the device, and launches just fine. 
However, in the “Application Output” pad you can see the debugger is waiting to connect, but the connection is never made, which is the real problem.
Comment 2 Rolf Bjarne Kvinge [MSFT] 2015-03-09 07:53:51 UTC
Please add "-v -v -v -v" to the additional mtouch arguments in the project's iOS Build options, rebuild, get the device log ("View -> Pads -> iOS Device Log") from a new debug attempt.
Comment 3 Jay DeBoer 2015-03-09 09:21:00 UTC
Here are the logs.  The line that seems interesting to me is "Mar  9 08:14:07 Jay-1 iPickAppiOS[1018] <Warning>: MonoTouch: No IPs to connect to."  It shows up when the debugger will not connect.

Mar  9 08:14:01 Jay-1 streaming_zip_conduit[199] <Warning>: LaunchServices: installing app for existing placeholder <LSApplicationProxy: 0x17d8bd00> com.digikey.iPick.App.iOS
Mar  9 08:14:01 Jay-1 streaming_zip_conduit[199] <Warning>: LaunchServices: Not creating progress for <LSApplicationProxy: 0x17d8bd00> com.digikey.iPick.App.iOS since it is not a placeholder.
Mar  9 08:14:01 Jay-1 installd[34] <Notice>: 0x313000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/iPickAppiOS.app" type Developer requested by streaming_zip_conduit (pid 199)
Mar  9 08:14:01 Jay-1 installd[34] <Notice>: 0x313000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.digikey.iPick.App.iOS; Version=1.0, ShortVersion=1.0>
Mar  9 08:14:02 Jay-1 profiled[110] <Notice>: (Note ) MC: Provisioning profiles changed
Mar  9 08:14:02 Jay-1 installd[34] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Mar  9 08:14:02 Jay-1 securityd[77] <Error>: ocsp response signed by certificate which does not satisfy ocspSigner policy
Mar  9 08:14:02 Jay-1 securityd[77] <Error>: CFReadStream posix: Connection refused
Mar  9 08:14:02 Jay-1 SpringBoard[42] <Warning>: Killing com.digikey.iPick.App.iOS for termination assertion
Mar  9 08:14:02 Jay-1 pkd[112] <Warning>: releasing plug-in hold CAC3972B-BA6A-40B1-92C4-6A989CDFE6E3 for dead client pid 42
Mar  9 08:14:02 Jay-1 com.apple.xpc.launchd[1] (UIKitApplication:com.digikey.iPick.App.iOS[0x5206][428]) <Notice>: Service exited due to signal: Killed: 9
Mar  9 08:14:02 Jay-1 iap2d[115] <Warning>: /SourceCache/iapd/iapd-1506.3.4/iap2d/iAP2Server.m:___xpc_iap2d_handle_incoming_request_block_invoke-1615 XPC_ERROR_CONNECTION_INVALID
Mar  9 08:14:02 Jay-1 iap2d[115] <Warning>: DEALLOC - /SourceCache/iapd/iapd-1506.3.4/iap2d/iAP2EAClient.m:-[iAP2EAClient dealloc] - 116 clientID=7
Mar  9 08:14:02 Jay-1 installd[34] <Notice>: 0x313000 -[MIInstallableBundle _refreshUUIDForContainer:withError:]: Data container for com.digikey.iPick.App.iOS is now at /private/var/mobile/Containers/Data/Application/C121956E-DECD-4312-B8BD-90236712E89F
Mar  9 08:14:02 Jay-1 SpringBoard[42] <Warning>: Application 'UIKitApplication:com.digikey.iPick.App.iOS[0x5206]' exited abnormally via signal.
Mar  9 08:14:02 Jay-1 iap2d[115] <Warning>: process com.digikey.iPick.App.iOS is now terminated
Mar  9 08:14:02 Jay-1 installd[34] <Notice>: 0x313000 -[MIContainer makeContainerLiveReplacingContainer:withError:]: Made container live for com.digikey.iPick.App.iOS at /private/var/mobile/Containers/Bundle/Application/DD34D3E8-7EEB-4570-8A91-A23D3919EFF4
Mar  9 08:14:03 Jay-1 installd[34] <Notice>: 0x313000 -[MIInstaller performInstallationWithError:]: Staging: 0.04s; Waiting: 0.00s; Installation: 1.52s; Overall: 1.56s
Mar  9 08:14:03 Jay-1 lsd[72] <Warning>: LaunchServices: Updating identifier store
Mar  9 08:14:03 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:03 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:03 Jay-1 notification_proxy[469] <Error>: 0x345000 notification_callback: No listeners for com.apple.mobile.application_installed
Mar  9 08:14:03 Jay-1 notification_proxy[469] <Error>: 0x3c7000 notification_callback: No listeners for com.apple.mobile.application_installed
Mar  9 08:14:03 Jay-1 syncdefaultsd[1014] <Notice>: (Note ) SYDAccount: no account
Mar  9 08:14:03 Jay-1 syncdefaultsd[1014] <Notice>: (Note ) SYDPIMAccount: no account (null)
Mar  9 08:14:03 Jay-1 syncdefaultsd[1014] <Notice>: (Note ) SYDAlwaysOnAccount: no account (null)
Mar  9 08:14:03 Jay-1 SpringBoard[42] <Error>: libMobileGestalt MobileGestalt.c:841: stand-alone-contacts is static and will never generate a notification
Mar  9 08:14:03 Jay-1 SpringBoard[42] <Error>: libMobileGestalt MobileGestalt.c:841: still-camera is static and will never generate a notification
Mar  9 08:14:03 Jay-1 SpringBoard[42] <Error>: libMobileGestalt MobileGestalt.c:841: any-telephony is static and will never generate a notification
Mar  9 08:14:03 Jay-1 SpringBoard[42] <Error>: libMobileGestalt MobileGestalt.c:841: nike-ipod is static and will never generate a notification
Mar  9 08:14:03 Jay-1 SpringBoard[42] <Warning>: Installed apps did change.
Added: {(
)}
Removed: {(
)}
Modified: {(
"com.digikey.iPick.App.iOS"
)}
Mar  9 08:14:04 Jay-1 mobile_installation_proxy[198] <Error>: 0x3dd000 handle_connection: Could not receive request from host.
Mar  9 08:14:04 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:04 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:04 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:04 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:04 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:04 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:05 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:05 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:05 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1016] <Warning>: debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
for armv7.
Mar  9 08:14:05 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1016] <Warning>: Connecting to com.apple.debugserver service...
Mar  9 08:14:06 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:06 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:06 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:06 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:07 Jay-1 kernel[0] <Notice>: flow_divert_token_set (0): Failed to get the key unit from the token: 22
Mar  9 08:14:07 Jay-1 lockdownd[25] <Error>: Could not set socket option SO_OPPORTUNISTIC: Invalid argument
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
for armv7.
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: Connecting to com.apple.debugserver service...
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: Got a connection, waiting for process information for launching or attaching.
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: About to launch process for bundle ID: com.digikey.iPick.App.iOS
Mar  9 08:14:07 Jay-1 amfid[208] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Mar  9 08:14:07 Jay-1 securityd[77] <Error>: ocsp response signed by certificate which does not satisfy ocspSigner policy
Mar  9 08:14:07 Jay-1 securityd[77] <Error>: CFReadStream posix: Connection refused
Mar  9 08:14:07 Jay-1 kernel[0] <Notice>: xpcproxy[1018] Container: /private/var/mobile/Containers/Data/Application/C121956E-DECD-4312-B8BD-90236712E89F (sandbox)
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: In completion handler, got pid for bundle id, pid: 1018.
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: Got a connection, launched process /private/var/mobile/Containers/Bundle/Application/DD34D3E8-7EEB-4570-8A91-A23D3919EFF4/iPickAppiOS.app (pid = 1018).
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: 1 +0.000000 sec [03f9/0907]: Disabling breakpoints and watchpoints, and detaching from 1018.
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: 2 +0.000829 sec [03f9/0907]: error: ::ptrace (request = PT_THUPDATE, pid = 0x03fa, tid = 0x2903, signal = -1) err = Invalid argument (0x00000016)
Mar  9 08:14:07 Jay-1 SpringBoard[42] <Warning>: LICreateIconForImage passed NULL CGImageRef image
Mar  9 08:14:07 Jay-1 locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: 3 +0.097693 sec [03f9/0f07]: error: ::read ( -1, 0x8949ec, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1017] <Warning>: Exiting.
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1016] <Warning>: 1 +0.000000 sec [03f8/0907]: error: ::read ( 6, 0x5c5dac, 1024 ) => 0 err = No such file or directory (0x00000002)
Mar  9 08:14:07 Jay-1 com.apple.debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-320.2.89
[1016] <Warning>: Exiting.
Mar  9 08:14:07 Jay-1 mobile_installation_proxy[198] <Error>: 0x3dd000 handle_connection: Could not receive request from host.
Mar  9 08:14:07 Jay-1 mobile_installation_proxy[198] <Error>: 0x461000 handle_connection: Could not receive request from host.
Mar  9 08:14:07 Jay-1 iPickAppiOS[1018] <Warning>: MonoTouch: No IPs to connect to.
Mar  9 08:14:08 Jay-1 iPickAppiOS[1018] <Error>: assertion failed: 12B466: libxpc.dylib + 51955 [63E5390F-F156-3BDC-AD59-B826676CE6D0]: 0x7d
Mar  9 08:14:08 Jay-1 Unknown[1018] <Error>:
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: process com.digikey.iPick.App.iOS is now running the foreground
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: /SourceCache/iapd/iapd-1506.3.4/iap2d/iAP2Server.m:___xpc_iap2d_handle_incoming_request_block_invoke-851 IAPAppRegisterClient
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: INIT - /SourceCache/iapd/iapd-1506.3.4/iap2d/iAP2EAClient.m:-[iAP2EAClient initWithCapabilities:auditToken:xpcConnection:andBundleId:] - 84 capability=0x20
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: com.digikey.iPick.App.iOS supports EA while suspended = NO
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: com.digikey.iPick.App.iOS supports EA while backgrounded = YES
Mar  9 08:14:09 Jay-1 iap2d[115] <Warning>: /SourceCache/iapd/iapd-1506.3.4/iap2d/iAP2Server.m:___xpc_iap2d_handle_incoming_request_block_invoke-1008 IAPAppConnectedAccessories
Comment 4 Jay DeBoer 2015-03-09 09:44:38 UTC
This bug seems to be missing some important details.  First off, this this problem only exists in the project once I migrated it to the Unified API.  I have a branch before the Unified API and it works just as expected. I can switch branches back and forth and the Unified API WiFi debugger will never connect, and the Classic API WiFi debugger works like a charm every time. I will post another private comment with a link to the unified API project.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-03-09 10:14:41 UTC
Jeff, it looks like our MSBuild tasks don't add the IPs of the machine to MonoTouchDebugConfiguration.txt, so wifi debugging doesn't work.
Comment 7 Jay DeBoer 2015-03-09 10:54:38 UTC
Is there a workaround for this?  Or do I just need to be patient and wait for the fix.  :)
Comment 8 Rolf Bjarne Kvinge [MSFT] 2015-03-09 11:45:11 UTC
@Jay, I think it's possible to work around this if you know a lot about MSBuild (in which case I believe you can edit your project file so that the MonoTouchDebugConfiguration.txt file within the .app ends up with the right contents). I don't know enough to answer that better though.
Comment 9 Jeffrey Stedfast 2015-03-09 12:41:00 UTC
There's no way to fix this currently other than editing your .csproj and adding the following lines to your Debug configuration sections:

<IOSDebuggerConnectOverUsb>False</IOSDebuggerConnectOverUsb>

Other options that you can set:

<!-- use a ;-delimited list of host IPs... without this value, the MSBuild system will try to guess the IPs of your local machine -->
<IOSDebuggerHosts>127.0.0.1;127.0.0.2</IOSDebuggerHosts>
<IOSDebuggerPort>10000</IOSDebuggerPort>


The problem is that there's currently no way for Xamarin Studio to pass along the USB vs WiFi debug setting to xbuild.
Comment 10 Jay DeBoer 2015-03-09 12:53:11 UTC
@Jeffery, Adding the IOSDebuggerConnectOverUsb line to the .csproj file did the trick!  Thanks so much!
Comment 11 Jeffrey Stedfast 2015-03-09 12:59:51 UTC
No problem. Now we just need to find a way to pass that info to xbuild from XS...
Comment 12 Rolf Bjarne Kvinge [MSFT] 2015-03-12 06:45:17 UTC
*** Bug 26668 has been marked as a duplicate of this bug. ***