什么是libswiftRemoteMirror.dylib,为什么它包含在我的应用程序包中? [英] What is libswiftRemoteMirror.dylib and why is it being included in my app bundle?

查看:350
本文介绍了什么是libswiftRemoteMirror.dylib,为什么它包含在我的应用程序包中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iOS应用程序,我最近切换到Xcode 8.
作为其中的一部分,我们从swift 2.2切换到2.3(swift 3将在稍后出现)。

I've got an iOS app which I've recently switched to Xcode 8. As part of that we switched from swift 2.2 to 2.3 (swift 3 will come later).

我有一个自动构建管道,基本上运行 xcodebuild 在专用构建机器上生成发布二进制文件,然后我对所有这些进行了排序out(Xcode 8的自动代码签名确实搞砸了所有内容),现在当我将我的应用程序上传到iTunes connect时,它失败并出现此错误:

I've got an automated build pipeline which essentially runs xcodebuild to produce a release binary on a dedicated build machine, and after I sorted all that out (Xcode 8's automatic code signing really screws everything up), now when I upload my app to iTunes connect, it fails with this error:


错误ITMS-90171:无效的束状结构 - 二进制文件‘MyApp.app/libswiftRemoteMirror.dylib’不允许您的应用程序不能包含独立的可执行文件或库,比支持束的CFBundleExecutable其他参考捆绑。 https://developer.apple.com/go/?id=bundle-structure 上的编程指南有关iOS应用程序包结构的信息。

ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'MyApp.app/libswiftRemoteMirror.dylib' is not permitted. Your app can't contain standalone executables or libraries, other than the CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."

果然,如果我解压缩.ipa文件并查看,那里就有 libswiftRemoteMirror.dylib

Sure enough, if I unzip the .ipa file and have a look, there's libswiftRemoteMirror.dylib sitting there.

如果我通过Xcode存档/导出iTunes,那么它会生成一个没有 libswiftRemoteMirror.dylib 的应用程序包,但是我的应用程序的所有其他版本都显示为有它。即使只是在Xcode中进行调试构建,然后查看输出显示libswiftRemoteMirror.dylib位于我的应用程序包中,表明Xcode本身肯定是在那里,而不是我的自动构建脚本的任何部分。

If I archive/export for iTunes via Xcode, then it produces an app bundle which does not have libswiftRemoteMirror.dylib, however all other builds of my app appear to have it. Even just doing a debug build within Xcode, then looking at the output shows that libswiftRemoteMirror.dylib is sitting in my app's bundle, indicating that Xcode itself is definitely putting it there, not any part of my automated build script.

这是什么文件,为什么要放在那里,我该怎么办呢?
我可以修改我的构建脚本以删除此文件以用于发布版本,但我担心这可能会影响代码签名过程。无论如何我会试一试,看看会发生什么,但感觉这不是正确的事情。

What is this file, why is it being put there, and what should I do about it? I can modify my build script to delete this file for release builds, but I'm concerned that might affect the code signing process. I'll try it anyway and see what happens, but it feels like that's not quite the right thing to be doing.

任何建议都会受到赞赏。

Any advice would be appreciated.

推荐答案

我永远无法让命令行xcodebuild使用自动代码签名。我假设,因为自动构建机器作为一个不同的帐户运行,只能通过SSH访问 - 它从来没有完整Xcode作为该用户帐户运行,并且它没有任何证书在其登录钥匙链或类似的东西。

I could never get command line xcodebuild to ever work with automatic code signing. I assume because the automated build machine runs as a different account which is only accessed via SSH - It's never had "full" Xcode run as that user account and it doesn't have any certificates in it's Login keychain or anything like that.

我不想使用 shenzhen 这样的东西,因为我从那些东西中得到了不好的经验以往。 Xcode构建系统复杂而且非常脆弱,无需添加更多可能出错或过时的脚本和内容。

I didn't want to use something like shenzhen because I've had nothing but bad experiences from those kinds of things in the past. The Xcode build system is complicated and fragile enough without having to add in more scripts and things that could go wrong or out of date.

这是我最终要修复的内容问题(这很可怕,但这是我能找到的唯一让它最终发挥作用的东西)

Here's what I ended up doing to fix the problem (it's horrible, but it was the only thing I could find that made it work in the end)


  1. 在自动构建脚本,编辑 .pbxproj 以搜索并替换 Provisioning Style = Automatic; with 供应方式=手动; 。还要将 iOS Developer 替换为 iOS Distribution ,以获取同一pbxproj文件中的代码签名内容。这两件事关闭了自动签名

  1. In the automated build script, edit the .pbxproj to search and replace Provisioning Style = Automatic; with Provisioning Style = Manual;. Also replace iOS Developer with iOS Distribution for the code signing stuff in the same pbxproj file. These two things turn off automatic signing

运行 xcodebuild 来构建(但不归档)项目就像我在Xcode7中所做的那样。 Xcode编译应用程序并对其进行签名,但它尚未生效,因为它包含 libswiftRemoteMirror.dylib 并且由于某种原因还没有任何权利文件

Run xcodebuild to build (but not archive) the project in the same way I did in Xcode7 . Xcode compiles the app and signs it, but it's not valid yet, as it contains libswiftRemoteMirror.dylib and also for some reason hasn't got any entitlements file

从应用包中删除 libswiftRemoteMirror.dylib (这使签名无效)

Delete libswiftRemoteMirror.dylib from the app bundle (this invalidates the signature)

通过从配置文件中提取权利位来生成应用程序包文件夹中的 Entitlements.plist (例如 BlackBerry的SWSiOSResign.sh 脚本确实如此)

Generate an Entitlements.plist in the app bundle folder by extracting the entitlements bit from the provisioning profile (Like what BlackBerry's SWSiOSResign.sh script does)


  1. 使用代码签名重新签名应用程序包--entitlements< file>

从那里,使用与 bq / package_ipa.sh 并复制SwiftSupport文件夹,将文件压缩为 ipa


我实际上无法使用 package_ipa.sh 文件,我需要重新实现类似的逻辑,因为我需要引用 Swift_2.3.toolchain 从我的应用程序获得SwiftSupport仍然是swift 2.3 - 不是 XcodeDefault.toolchain (这是swift 3)

I couldn't actually use package_ipa.sh file, I needed to re-implement similar logic instead because I need to reference Swift_2.3.toolchain to get the SwiftSupport from as my app is still swift 2.3 - not XcodeDefault.toolchain (which is swift 3)

似乎我应该能够将 xcodebuild --archive 与其他一些东西结合使用避免其中一些步骤。我永远无法在Xcode7下工作,但如果我有时间,我可能会再次尝试使用XC8

It seems like I should be able to use xcodebuild --archive in combination with some other things to avoid some of these steps. I could never get that to work under Xcode7, but I might try again with XC8 if I have time

这篇关于什么是libswiftRemoteMirror.dylib,为什么它包含在我的应用程序包中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆