Jenkins iOS Codeigning失败,退出代码为1

时间:2017-11-10 22:37:03

标签: ios iphone xcode macos jenkins

需要配置哪些Jenkins设置才能为苹果移动设备签署iOS应用程序?我正试图在备用的MacBook上安装Jenkins,以便首次在新的iOS应用上进行CI。

  • 我可以从命令行构建和部署
  • Jenkins配置为使用与在终端PATH=~/Qt/5.9.2/ios/bin:$PATH make -j 12 QMAKE_FLAGS="QPROTOC=/Users/admin/projects/build-QObjectProtobufCompiler-Desktop_Qt_5_9_2_clang_64bit-Debug/qprotoc/qprotoc CONFIG+=iphoneos CONFIG+=device" BUILD_ARCH=ios
  • 中工作的命令相同的命令
  • 我将Jenkins设置为使用与我在命令行上构建的用户相同的用户(包括更改文件夹,日志等所有权)
  • 这是一个qt项目(make调用qmake然后在自动生成的makefile上创建)

这是我得到的Jenkins错误输出:

 PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/    Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module connect     --output-partial-info-plist /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/connect.build/    Debug-iphoneos/connect.build/LaunchScreen-PartialInfo.plist --auto-activate-custom-fonts --target-device     iphone --target-device ipad --minimum-deployment-target 8.0 --output-format human-readable-text --compile /    Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app/LaunchScreen.nib /    Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/connect.xcodeproj/LaunchScreen.xib

ProcessInfoPlistFile Debug-iphoneos/connect.app/Info.plist /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/app/    ios/Info.plist
    cd /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/    Applications/Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/app/ios/Info.plist -genpkginfo /    Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app/PkgInfo     -expandbuildsettings -format binary -platform iphoneos -additionalcontentfile /Users/Shared/Jenkins/Home/    workspace/mobileAppIOS/.build/ios/app/connect.build/Debug-iphoneos/connect.build/Launch-PartialInfo.plist     -additionalcontentfile /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/connect.build/    Debug-iphoneos/connect.build/LaunchScreen-PartialInfo.plist -o /Users/Shared/Jenkins/Home/workspace/    mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app/Info.plist

ProcessProductPackaging /Users/admin/Library/MobileDevice/Provisioning\ Profiles/    REDACTED.mobileprovision Debug-iphoneos/connect.app/embedded.mobileprovision
    cd /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/    Applications/Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-productPackagingUtility /Users/admin/Library/MobileDevice/Provisioning\ Profiles/    REDACTED.mobileprovision -o /Users/Shared/Jenkins/Home/workspace/    mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app/embedded.mobileprovision

Touch Debug-iphoneos/connect.app
    cd /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/    Applications/Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /usr/bin/touch -c /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app

ProcessProductPackaging "" connect.build/Debug-iphoneos/connect.build/connect.app.xcent
    cd /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/    Applications/Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"


Entitlements:

{
    "application-identifier" = "REDACTED.com.precisionplanting.connect";
    "com.apple.developer.team-identifier" = REDACTED;
    "get-task-allow" = 1;
    "keychain-access-groups" =     (
        "REDACTED.com.precisionplanting.connect"
    );
}


    builtin-productPackagingUtility -entitlements -format xml -o /Users/Shared/Jenkins/Home/workspace/    mobileAppIOS/.build/ios/app/connect.build/Debug-iphoneos/connect.build/connect.app.xcent

CodeSign Debug-iphoneos/connect.app
    cd /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app
    export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin    /codesign_allocate
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/    Applications/Xcode.app/Contents/Developer/usr/bin:/Users/admin/Qt/5.9.2/ios/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: Michael Rink (REDACTED)"
Provisioning Profile: "iOS Team Provisioning Profile: *"
                      (REDACTED)

    /usr/bin/codesign --force --sign EA9034E507C1108550F4A5269522F7EAA05FDE05 --entitlements /Users/Shared/Jenkins/    Home/workspace/mobileAppIOS/.build/ios/app/connect.build/Debug-iphoneos/connect.build/connect.app.xcent     --timestamp=none /Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app
/Users/Shared/Jenkins/Home/workspace/mobileAppIOS/.build/ios/app/Debug-iphoneos/connect.app: unknown error     -1=ffffffffffffffff
Command /usr/bin/codesign failed with exit code 1

** BUILD FAILED **


The following build commands failed:
    CodeSign Debug-iphoneos/connect.app
(1 failure)
make[2]: *** [xcodebuild-debug-device] Error 65

1 个答案:

答案 0 :(得分:0)

关键是启用包含证书和配置文件的钥匙串以进行代码签名。这可以通过以下方式完成:

if (isset($this->prefixLengthsPsr4[$first])) {
    // ...
}

This是fastlane的github上的一个相关问题

This是我写的使用fastlane和Jenkins建立整个管道的帖子