ios - 如何通过 ssh 运行 xcodebuild 命令?

标签 ios xcode ssh xcodebuild

我正在尝试通过 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/

相关文章:

ssh - 使用GFTP连接到Amazon AWS(SSH使用 key 身份验证.pem)

iphone - 我可以在 iOS 的系统键盘上添加一个键吗?

c - 如何基于 Makefile 构建 iPhone 静态库?

iphone - 具有方向或箭头主题的 UISegmentedControl

iphone - xcode 4 调试显示大多数对象为 'Summary Unavailable'

ssh - 如何通过 ssh 连接到多个防火墙后面的远程服务器?

iphone - 如何从我们的服务器中找到是否已发送给用户的 Apple Push Notification?

iphone - UIButton 上的 backgroundImage 缩放错误

xcode - SwiftUI - 使 mac 无法使用

bash - 捕获期望的 ssh 输出到变量