iOS Build Environment Help Center

Local Network unaviable when disable remote debug console

append delete vivasjanettaaih72

Ping localnetwork always faild on iOS 14.7.1.
win10, iOS builder v3.36.1 iOS SDK 14.5.
if disable remote debug console than ping local network always timeout.Even local network permission is on.

when I enable remote debug console make a build. the ping local network magicaly success.

To reporduce this problem, disable remote debug console in iOS builder,build and run.
In iPhone type local network ip like 192.168.1.1, than iOS will pop a permission window, allow it. than test ping a local ip. will get timeout.here is my code:
=============================================================
public InputField inputField;

public void OnStratPingButton() {
Stopwatch s = new Stopwatch();
s.Start();
var p = new Ping(inputField.text);
Debug.Log("startping:"+ inputField.text);
while (!p.isDone && s.ElapsedMilliseconds < 3000) {
Thread.Sleep(100);
}
Debug.Log("timeout:"+(s.ElapsedMilliseconds) +"|"+p.time);
s.Stop();
}

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

The fact that the remote debug console enables local network access is not a bug. Permission is explicitly asked to the user to allow the app to discover the local network when an iOS app with the remote debug console enabled is run for the first time on your iOS device. As soon as permission is granted, the app can communicate with the network and the remote debug console starts working the next time the app is run.

However, I don't understand what the fact that the local network access is prohibited when you *don't* enable the remote debug console is related to the builder. When you don't enable the remote debug console, the app is built just like Xcode would build it, without additional code.

Is that behaviour you describe different when the app is built with Xcode ?

append delete #2. vivasjanettaaih72

Use xcode build project ping local network ip is success.

When disable remote console debug use iOS builder pin local network always fail, even localnetwork permission is on.
When enable remote console debug use iOS builder pin local network is success.
seem like disable remote console debug block local network traffic

append delete #3. Pierre-Marie Baty

This rather sounds like a missing entitlement in the app binary, and possibly a builder issue indeed that I have to fix.

Could you please send me the two .ipa files to my email address, the one built with Xcode, and the one built with the builder with the debug console disabled. I'll do some binary comparison and try to identify the cause of the issue.

Thanks in advance

append delete #4. vivasjanettaaih72

No problem, I will rebuild soon later.

append delete #5. Pierre-Marie Baty

I'm still interested in getting those .ipa files and doing the binary comparison... Have you sent them already ?

append delete #6. Chris

I am seeing the same behavior. Building on Windows I never get a permissions popup. Building the same project on Mac I get the popup. Preparing both .ipas now

append delete #7. Pierre-Marie Baty

Hello

Have you sent them ? Or does my mailbox have a problem ?

append delete #8. Chris

Sent. Sorry for the delay

append delete #9. Pierre-Marie Baty

Well received. I'll have a look at it and post back when I find the cause. Thank you for your patience.

:: @Pierre-Marie Baty added on 21 Oct ’21 · 11:00

I see indeed a difference in the app's entitlements. In the Xcode version, the "application-identifier" entitlement is resolved to an explicit value (the value "TJ36M4SL9C.com.sixfeetdeep.*" is replaced by the constructed value "TJ36M4SL9C.com.sixfeetdeep.pinganother"), whereas the builder leaves the wildcard value intact. That's the only significant difference I see. I think fixing it is likely to solve a number of other mysterious problems. Let me see...

:: @Pierre-Marie Baty added on 21 Oct ’21 · 12:41

Okay, I emailed you with the URL of a hotfix. Can you please try it and post your feedback ?

append delete #10. Chris

Thanks for the hotfix. I'm now getting an error:

%
  + [arm64] Compiling Classes/Native/UnityICallRegistration.cpp...
   + [arm64] Compiling Classes/Native/UnresolvedVirtualCallStubs.cpp...
   + [arm64] Including Libraries/libiPhone-lib.a...
   + [arm64] Including Libraries/libil2cpp.a...
   + [arm64] Including Libraries/baselib.a...
   + [arm64] Linking UnityFramework...
ld: warning: method '-viewDidAppear:' in category from build/Release-iphoneos/UnityFramework/arm64/Classes/UI/UnityViewControllerBase+iOS.mm.obj overrides method from class in build/Release-iphoneos/UnityFramework/arm64/Classes/UI/UnityViewControllerBase.mm.obj
 + Creating universal framework (arm64)...
 + Copying resources...
 + Creating Info.plist...
ldid: fatal: couldn't construct the DER representation of the XML entitlements.

Press any key to continue . . .

%
append delete #11. Pierre-Marie Baty

Okay. I must have missed something. Here we go again... I'll be right back.

:: @Pierre-Marie Baty added on 21 Oct ’21 · 19:17

Alright, issue hopefully fixed. Please check your email.

append delete #12. Chris

Ok with the latest hotfix sent I am able to build but it did not fix the problem. Any attempt to access local network I still just get a "no route to host" without the iOS popup triggering.

But if I turn on the remote debug console for the build (or select "Development Build" and "Autoconnect Profiler" in the Unity build settings), the popup appears at the beginning, and all subsequent local network attempts go through.

append delete #13. Pierre-Marie Baty

I'm thinking it might be because iOS remembers the authorizations already granted to this app ID. Try changing the app's identifier ("com.sixfeetdeep.somethingelse"). Does it help ?

append delete #14. Chris

I tried deleting the app from my phone (which I believe would clear out any settings) before installing new build.

I also tried with another project. Didn’t work with that either.

Just to be sure I will try changing the identifier with the test project and report back (but I’m not hopeful)

append delete #15. Pierre-Marie Baty

Please let me know. I have identified a few other differences, but they're so minor that I don't understand how they could change anything.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty