Browse Source
上一版用 App Group + Unix domain socket 传音频,结果签不出包: - com.yimai.eaimar 的 profile 不带 App Groups capability - com.yimai.eaimar.BroadcastExtension 没有任何 profile 而 Xcode 又登录不上账号去申请(-1200)。实测原因是网络层: developer.apple.com 通(200),appleid.apple.com 与 developerservices2.apple.com 都连不上(000)——后两个正是登录与签发 profile 要走的域名。 改成环回 TCP 之后不需要任何 entitlement:扩展和主 App 在同一台设备上, 127.0.0.1 天然互通,而且不触发 iOS 的「本地网络」隐私弹窗(那个只针对局域网, 环回是明确豁免的)。主 App 的 entitlements 回到原样,用已有的 profile 就能签, 扩展的 profile 由自动签名就地生成。已真机安装成功。 代价:没有 App Group 就没有地方发布「主 App 这次监听在哪个端口」,只能约定 一个固定端口(52781,两边手工同步,注释里写明了)。撞端口时主 App bind 会 失败并打日志,不是静默失败。 顺带补的两个 socket 选项: - SO_REUSEADDR:上次进程被杀后端口停留在 TIME_WAIT,不开的话几十秒内 bind 都会 EADDRINUSE,表现是「刚重启 App 就用不了」。 - TCP_NODELAY:音频要低延迟,攒包没有意义。 - 只绑 127.0.0.1 而不是 INADDR_ANY,否则这个端口对局域网可见。 另外记两个这次踩到的构建坑: - flutter clean 会删掉 ios/Flutter/ephemeral/,其中的 swift_sdk_local 软链由 Podfile 的补丁在 pod install 时创建、**flutter 不会自己重建**,于是后续 xcodebuild 直接卡在 "Could not resolve package dependencies"。清理之后要 补跑一次 pod install。 - 跑过 --no-codesign 之后再跑签名构建,会复用 build/ 里未签名的 framework, 装机时报 objective_c.framework "invalid signature"。中间做过 no-codesign 验证的话,出正式包前要先 flutter clean。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>main
6 changed files with 77 additions and 128 deletions
@ -1,10 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
|
||||
<plist version="1.0"> |
|
||||
<dict> |
|
||||
<key>com.apple.security.application-groups</key> |
|
||||
<array> |
|
||||
<string>group.com.yimai.eaimar</string> |
|
||||
</array> |
|
||||
</dict> |
|
||||
</plist> |
|
||||
Loading…
Reference in new issue