xcodebuild 对 AMSupportURLConnectionDelegate 和 AMSupportURLSession 的多个实现给出错误:“哪一个未定义。”

Mes*_*NEŞ 8 xcode xcodebuild ios apple-m1

当我想运行任何xcodebuild操作时,它会给出以下错误,而 Xcode ide 在 Apple M1 上运行良好。

> xcodebuild -version
objc[72320]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1dc35ab90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105ca42c8). One of the two will be used. Which one is undefined.
objc[72320]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1dc35abe0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x105ca4318). One of the two will be used. Which one is undefined.
Xcode 13.2.1
Build version 13C100
Run Code Online (Sandbox Code Playgroud)

这两个类都是在/usr/lib/libauthinstall.dylib另一个模块中实现的,所以我想检查/usr/lib/libauthinstall.dylib但它无法访问

> open /usr/lib/libauthinstall.dylib
The file /usr/lib/libauthinstall.dylib does not exist.
Run Code Online (Sandbox Code Playgroud)

Ven*_*iev 5

我在 M1 上又遇到了同样的问题。看来 xcodebuild 可执行文件是基于 Intel 的。该错误不会显示 xcodebuild 进程是否从 Rosetta 下运行的终端启动。

我的 Xcode 是从 App Store 安装的。

通过删除 Xcode 并安装 13.3 Xcode beta,成功修复了没有 Rosetta 的终端: https: //download.developer.apple.com/Developer_Tools/Xcode_13.3_beta/Xcode_13.3_beta.xip

现在,xcodebuild 可执行文件已针对 Apple 芯片进行了编译,问题就消失了。