【问题标题】:How to run xcodebuild commands via ssh?如何通过 ssh 运行 xcodebuild 命令?
【发布时间】:2018-06-15 18:10:36
【问题描述】:

我正在尝试通过 ssh 使用 xcodebuild 命令运行 iOS 测试。当我尝试运行那些构建和运行 iOS UI 测试的命令时,我遇到了以下错误。

注意:我的 ssh 计算机上的所有钥匙串都已解锁。

命令

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)

【问题讨论】:

  • 当我尝试直接从机器上运行这个命令时,它运行得很好。当我 ssh 进入时发生上述错误。

标签: ios xcode ssh xcodebuild


【解决方案1】:

我的猜测是,尽管您的钥匙串中有正确的项目,但它仍然需要解锁才能正确执行构建过程。当ssh 在(构建之前)尝试:

$ security unlock-keychain

如果你的钥匙串没有解锁,它需要一个窗口服务器连接 为了提示用户解锁钥匙串。使用安全性(1) 在执行之前解锁远程机器上的钥匙串 xcodebuild.

如果这对你不起作用please review this question and subsequent answers

【讨论】:

  • 您可以使用 -p 标志在没有窗口服务器连接的情况下解锁钥匙串
猜你喜欢
  • 2013-06-05
  • 2015-07-24
  • 1970-01-01
  • 2013-05-08
  • 1970-01-01
  • 2023-03-25
  • 2010-10-08
  • 2011-01-25
  • 1970-01-01
相关资源
最近更新 更多