adhoc ipa, installed on iOS 18 devices, udp and tcp cannot access the local network, such as 17.25.11.128

I have read all the information and forum posts about local network, such as TN3179, etc., and have added NSLocalNetworkUsageDescription, but it does not solve my problem.

The problem I encountered is described as follows: Device: iOS18.1.1 Signing method: automatic Xcode debug directly runs, and the app can access 17.25.11.128 normally. However, relase run or packaged into adhoc installation, this IP cannot be accessed. There is a phenomenon that the app package of the App Store can also be used.

Our test team has few iOS18+ devices, and internal testing is not possible. Please contact us as soon as possible, thank you.

=======

我已经了解了所有关于local network 相关的资料和论坛帖子,比如TN3179 等等, 已经添加了 NSLocalNetworkUsageDescription, 但是不解决我的问题。

我遇到的问题描述如下: 设备:iOS18.1.1 签名方式:自动 xcode debug 直接运行,app是可以正常访问17.25.11.128的。 但是 relase run 或者 打包成 adhoc 安装,就无法访问这个IP了。 有一个现象, App Store 的app包 也是可以的。

我们的测试团队,iOS18+的设备就没几个,还不能内部测试了。请尽快联系我们,谢谢。

Answered by DTS Engineer in 840519022

On iOS, how you sign your app has no impact on local network privacy [1]. Most reports of problems like this aren’t related to code signing but rather to the build configuration, Debug or Release. You can tease these apart using the process described in Isolating Code Signing Problems from Build Problems.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] On macOS there’s an exception to this rule, namely that you must sign your app with a stable code-signing identity. That allows the system to track the identity of your app from release to release. TN3127 Inside Code Signing: Requirements talks about this idea in general.

This case never crops up on iOS because all iOS code is signed using an Apple-issue code-signing identity.

On iOS, how you sign your app has no impact on local network privacy [1]. Most reports of problems like this aren’t related to code signing but rather to the build configuration, Debug or Release. You can tease these apart using the process described in Isolating Code Signing Problems from Build Problems.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] On macOS there’s an exception to this rule, namely that you must sign your app with a stable code-signing identity. That allows the system to track the identity of your app from release to release. TN3127 Inside Code Signing: Requirements talks about this idea in general.

This case never crops up on iOS because all iOS code is signed using an Apple-issue code-signing identity.

Thank you for your reply. We use xcode to modify scheme Run from Debug to Release, run the App, and it works fine. Run release directly in xcode, and it works fine. But xcode archive, then export adhoc ipa, install and run this ipa, and an error is reported, and the local network cannot be connected.

Both are in the system settings, and the local network switch of the App is turned on. I checked No route to host, and the error code is 65. The network configuration is the same, and it is definitely not a problem with the network connection Wi-Fi. Later, I will make a demo and put it on github, and give a link. I'm a little sorry that the source code cannot be disclosed.

You can contact me directly, by phone or email. Thank you for your reply again.

#define EHOSTUNREACH 65 /* No route to host */

[2025-05-26 14:16:45.457] [debug] [q_hdd]: 2025-05-26 06:16:45.456 [error] [Bifrost] [6140817408] dcc8e1bb NetConfig.cpp:471 Poco::Exception exception: Net Exception: No route to host: 172.25.11.120:443. [1620449] [11476] [AppDelegate.swift:340] [onPrintLog(_:logMessage:)]

=== 谢谢你的回复。我们使用xcode 修改 scheme Run ,由之前的Debug,修改为 Release,运行App,表现正常。 在xcode 中直接run release, 表现正常了。 但是xcode archive,然后export adhoc ipa,安装运行这个ipa,就报错了,无法连接本地网络。

两者都在系统设置中,打开了App的本地网络开关。我查了一下No route to host,错误码为65。 网络配置都是一样的,绝不是网络连接Wi-Fi问题。 稍后,我制作一个demo 放在github上,给出链接。稍稍抱歉,源码不太能透露。

你们可以直接联系我,电话或者邮箱。 谢谢你的再次回复。

#define EHOSTUNREACH 65 /* No route to host */

[2025-05-26 14:16:45.457] [debug] [q_hdd]: 2025-05-26 06:16:45.456 [error] [Bifrost] [6140817408] dcc8e1bb NetConfig.cpp:471 Poco::Exception exception: Net Exception: No route to host: 172.25.11.120:443. [1620449] [11476] [AppDelegate.swift:340] [onPrintLog(_:logMessage:)]

Run release directly in xcode, and it works fine.

OK. I also recommend that you do the reverse:

  1. Do a Product > Archive.

  2. From the organiser, follow Distribute App > Debugging workflow.

Does that reproduce the problem?

Oh, and one other thing: I’ve recently bumped into a bug where iOS fails to apply local network privacy settings at runtime (FB14321888). So, the settings you see in Settings > Privacy & Security > Local Network aren’t always the settings that are being enforced by the system. To make sure that this isn’t affecting your test, I recommend that you restart. So, something like:

  1. Install the working app.

  2. Check that it works.

  3. Delete the app.

  4. Restart.

  5. Install the failing app.

  6. Test whether it fails.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for your reply. I wrote a demo and was able to reproduce it stably at least 3 times: delete the demo app, build release is normal, archive adhoc has an exception after installation.

After a while (maybe a few hours), I saw your reply to the post and prepared to record the scene. It appeared: build release reported an error on the local connection, and there was no need to achive adhoc, but build debug was normal. I did not do any restart operations, and did the same operation as before, deleting the app, xcode release run.

About 30 minutes later, I did some xcode clean, pod install and other operations in the demo, and I was a little skeptical about my life, but I still did not restart the phone. I tried again and found that buidl release was normal and archive adhoc was normal.

Later I restarted the phone and reset the privacy settings, and everything was normal.

Is it a problem with the phone system buffer, or some privacy switch?

=== ===

谢谢回复。 写了一个demo,能至少3次稳定复现:删除demo app, build release 正常, archive adhoc 安装后出现异常。 过了一段时间(may be 几个小时),看到你的帖子回复,准备录制现场,出现:build release 就本地连接报错了,都不用achive adhoc, 但是 build debug 是正常的。我都没有做任何重启操作,跟之前出现的时候一样操作,删除app, xcode release run。

大概过了30分钟,我在demo 里做了一些xcode clean , pod install 之类的操作,有点怀疑人生了,但是任然没有重启手机。再次尝试,发现 buidl release 正常, archive adhoc 正常。

后来我就重启手机了, 重置隐私设置,也都正常了。

难道是手机系统缓冲问题,或者有什么隐私开关之类的?

Is it a problem with the phone system buffer, or some privacy switch?

The bug I mentioned above (FB14321888) results in the state enforced by the system at runtime getting out of sync with the state recorded on disk (and hence shown in Settings). It’s possible for this problem to go away by itself because of the way that the system caches this state. However, restarting the device always clears the issue. So, if you’re seeing hard-to-explain behaviour with local network privacy, I recommend that you restart your device and try again.

Obviously this bug is quite bad and we hope to fix it sooner rather than later. However, it’s still present in iOS 18.5, which is the latest release of iOS that we’ve shipped or seeded.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

adhoc ipa, installed on iOS 18 devices, udp and tcp cannot access the local network, such as 17.25.11.128
 
 
Q