3 Replies
      Latest reply: Dec 21, 2016 2:36 PM by eskimo RSS
      YINGJUN_GAO Level 1 Level 1 (0 points)

        My app , in iphone6/6S(ios 10.1/2), can not create tcp connection, but in iphone5/5s and simulators(ios10.1) is ok. And I found that the system dialog to ask user for permission of network does not appear in iphone6/6s, so my app never appear in the list of network permit.

        Exception: no route to the host.

        • Re: How to request access to  netwneork for my app ,both wireless & 4G.
          eskimo Apple Staff Apple Staff (6,665 points)

          The most common cause of problems like this is app re-skinning.  The network interface access control mechanism is primarily based on your app’s bundle ID, but parts of it are keyed off the UUID of the main executable’s image UUID (that is, the LC_UUID command in the Mach-O header of the main executable).  If you re-skin your app (that is, have the same main executable wrapped in different apps, with different bundle IDs), the system can get very confused.  Are you doing that?  If so, I recommend you avoid this problem by changing your build process so that each app has a distinct bundle ID and a distinct image UUID.

          Share and Enjoy

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

            • Re: How to request access to  netwneork for my app ,both wireless & 4G.
              YINGJUN_GAO Level 1 Level 1 (0 points)

              Thanks, eskimo

              I am sure the app has a distinct bundle ID. But I know little about image UUID. Can it be set by developers?, and how, thank you very much.

                • Re: How to request access to  netwneork for my app ,both wireless & 4G.
                  eskimo Apple Staff Apple Staff (6,665 points)

                  I am sure the app has a distinct bundle ID.

                  Yeah, that’s rarely the problem here.

                  But I know little about image UUID.

                  The image UUID is set by the linker to a random value when it creates the Mach-O image.  The main executable image UUID is, as you might expect, the image UUID of the main executable.  If you’re building an app in the normal way, the main executable image UUID is going to be unique.  Where you run into problems is when you re-skin the app, that is, build the app once, ship that, then tweak some resources in the app, and ship it as a separate app.  At this point both apps have the same UUID because you never re-linked the app.

                  If you re-skins apps like this, you can use the following steps to see if you have a problem:

                  1. Using iTunes on your Mac, download each app from the store.

                  2. Still in iTunes, control click on the downloaded app and choose Show in Finder; this will reveal the .ipa file in the iTunes library.

                  3. Make a copy of that file and, on the copy, change the extension to .zip.

                  4. Unpack the .zip.

                  5. Dump the image UUID of the main executable using otool.  For example, here’s what I see for Apple’s AirPort Utility app.


                  $ otool -l -arch arm64 AirPort\ Utility\ 1.3.4/Payload/AirPort.app/AirPort | grep -A 2 LC_UUID
                      cmd LC_UUID
                  cmdsize 24
                    uuid 6F3E412B-DD11-3996-938C-3BD086E7AF2B
                  

                  Note that I’ve chosen the arm64 architecture.  The image UUID is different for each architecture.

                  If you see the same UUID for multiple apps, that’s definitely a problem.

                  Share and Enjoy

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