我正在尝试通过 ssh 使用 xcodebuild 命令运行 iOS 测试。当我尝试运行那些构建和运行 iOS UI 测试的命令时,我遇到了以下错误。
注意:我在 ssh 中解锁的机器上的所有钥匙串(keychain)都已解锁。
命令
HOME=/Users/mcj xcodebuild build-for-testing -project ios/ios_test_app/HXKPIIOS/HXKPIIOS.xcodeproj -scheme HXKPIIOS -destination 'platform=iOS,id=d623bacb04507071723fe1286c148edb822d5422' -derivedDataPath /opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data| tee /opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/uitest/build1.log
错误
/usr/bin/codesign '-r-' '--display' '/opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib'
/opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib: code object is not signed at all
Codesigning /opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib
/usr/bin/codesign '--force' '--sign' '<code sign identity>' '--verbose' '/opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib'
/opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib: unknown error -1=ffffffffffffffff
error: Task failed with exit 1 signal 0 {
/usr/bin/codesign '--force' '--sign' '<code sign identity>' '--verbose' '/opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app/Frameworks/libswiftCore.dylib'
}
** TEST BUILD FAILED **
The following build commands failed:
CopySwiftLibs /opt/HXKPI_Logs/oobe_iOS_2018-06-14-11-14-23-216414/build_derived_data/Build/Products/Debug-iphoneos/HXKPIIOS.app
(1 failure)
最佳答案
我的猜测是,尽管您的钥匙串(keychain)中有正确的项目,但它仍然需要解锁才能正确执行构建过程。当ssh
在(构建之前)尝试:
$ security unlock-keychain
If your keychain is not unlocked, it needs a window server connection in order to prompt the user to unlock the keychain. Use security(1) to unlock the keychain on the remote machine prior to executing the xcodebuild.
如果这对你不起作用 please review this question and subsequent answers .
关于ios - 如何通过 ssh 运行 xcodebuild 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50880744/