8 Replies
      Latest reply on Aug 13, 2018 2:07 PM by Suthap
      kgomara Level 1 Level 1 (0 points)

        I am trying to establish a remote connection to an iOS 11 device for debugging. Both devices are on the same Wi-Fi network, I'm using Xcode 9 and in Window->Devices and Simulators have checked the "Connect via network" box. I do not get a network icon next to my device, nor do I get any prompt on the device itself.

         

        The application if for point of sale and the Wi-Fi firewall has most ports blocked.  For example, I know port 22 (ssh) is blocked - the only open port I'm certain of is 8080. I suspect the port used for debugging is blocked. What port(s) are used for debugging? I can request the network guys open a few ports if needed. 

        • Re: Not able to "connect via network" for debugging
          tlafferty Level 1 Level 1 (0 points)

          Have you figured out what port is being used? I am also experiecing the same issue and would love to use the Wireless Debugging functionality.

          • Re: Not able to "connect via network" for debugging
            eskimo Apple Staff Apple Staff (12,295 points)

            Most problems like this boil down to one of two things:

            • The AP isn’t forwarding multicasts, so you can’t browse for services

            • The AP isn’t forwarding STA-to-STA traffic, so you can’t do any peer-to-peer networking

            Note If you’re unfamiliar with my terminology, read Wi-Fi Fundamentals.

            You can work around the first problem by the Connect via IP Address command, as discussed in WWDC 2017 Session 404 Debugging with Xcode 9.

            There’s no way to work around the second problem other than to reconfigure the AP.

            Share and Enjoy

            Quinn “The Eskimo!”
            Apple Developer Relations, Developer Technical Support, Core OS/Hardware
            let myEmail = "eskimo" + "1" + "@apple.com"

              • Re: Not able to "connect via network" for debugging
                kgomara Level 1 Level 1 (0 points)

                Thanks - very well written article about Wi-Fi.

                 

                The IT group that manages the Wi-Fi is extremely conservative, I wouldn't be surprised if the AP doesn't forward multicasts OR STA-to_STA traffic.  Wish me luck.

                  • Re: Not able to "connect via network" for debugging
                    kgomara Level 1 Level 1 (0 points)

                    Had time to review the Debugging with Xcode 9 session video. Unfortunately I do not see a "Connect via IP Address" option when I control-click on the device. Does that mean the AP is not forwarding multi-casts, or STA-to-STA traffic?

                     

                    The video also mentioned a document "please check out the wireless development documentation." containing more detailed information about ports and so on - I haven't had been able to locate these documents yet. The only mention I see in the "What's new in Xcode 9" article is a reference to Help - which doesn't help much. Can you point me in the right direction?

                      • Re: Not able to "connect via network" for debugging
                        eskimo Apple Staff Apple Staff (12,295 points)

                        Unfortunately I do not see a "Connect via IP Address" option when I control-click on the device.

                        Yeah, that can be a bit persnickety.  Here’s what I did to get it to show up:

                        1. I turned off Wi-Fi on my device, just to be sure it wasn’t being seen on the network.

                        2. I connected it via USB.

                        3. In Xcode’s Devices window, I selected the device on the left.

                        4. I enabled Connect via Network on the right.

                        5. I disconnected the USB; the device moved to the Disconnected section.

                        6. I control clicked on the device and Connect via IP Address shows up in the menu.

                        I didn’t actually choose the menu item because it wasn’t going to work because, hey, the Wi-Fi was off.  But that should at least get it to show up.

                        Does that mean the AP is not forwarding multi-casts, or STA-to-STA traffic?

                        You can test this as follows:

                        1. Run through the process above.

                        2. In your Mac, start a Bonjour discovery from Terminal:

                          $ dns-sd -B _apple-mobdev2._tcp. local.

                          -

                        3. Turn on Wi-Fi on the device.  You should see dns-sd log a line like this:

                          10:20:24.099  Add        2   5 local.               _apple-mobdev2._tcp. 40:33:1a:d7:f4:9b@fe80::4233:1aff:fed7:f49b

                          where 40:33:1a:d7:f4:9b@fe80::4233:1aff:fed7:f49b is the Bonjour service name (it seems that Xcode uses the MAC address and the link-local IPv6 for the service name, which is wacky but there you go).

                        If the service doesn’t show up, Wi-Fi multicast is disabled.  In that case you can try the Connect via IP Address process described above.  If that doesn’t work, it’s likely that all STA-to-STA networking is disabled.

                        Share and Enjoy

                        Quinn “The Eskimo!”
                        Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                        let myEmail = "eskimo" + "1" + "@apple.com"

                  • Re: Not able to "connect via network" for debugging
                    GameDevBryant Level 1 Level 1 (0 points)

                    I'm not sure if this will help you at all, but I came upon your post trying to fix the same issue with my app and Xcode.

                     

                    I had it working previously no problem by just checking "Connect via Network" in the Devices/Simulators window but somehow it stopped working.

                     

                    To fix it, I had to make sure that my app installed on my device via Xcode was removed (only had the 1). As soon as I uninstalled that, the Network icon appeared right by my device and it started working again. This was also done by unpairing the device and re-pairing it to Xcode, but that by itself didn't fix it. Maybe this will help someone else!