命令/ usr / bin / codesign失败,退出代码为1-代码符号错误 [英] command/usr/bin/codesign failed with exit code 1- code sign error

查看:1140
本文介绍了命令/ usr / bin / codesign失败,退出代码为1-代码符号错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在向Apple商店提交我的第一个应用程序。
我已完成以下流程


  1. 获取开发者帐户

  2. 已登录创建应用程序ID的成员中心

  3. 使用钥匙串访问请求和接收分发证书

  4. 使用我的ID和证书获取配置文件

当我构建应用程序时,它在应用程序模拟器和实际的ipad上运行完美,但是当我将应用程序切换到<$ c时iOS设备上的$ c>存档我有一个主要的代码签名错误,我已在下面附上。

  codesign /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app 
cd / Users / Gaby / Desktop / RoyalAppInspection
export CODESIGN_ALLOCATE = / Applications / Xcode.app / Contents / Developer / Toolchains / XcodeDefault.xctoolchain / usr / bin / codesign_allocate
export PATH =/ Applications / Xcode.app / Contents / Developer / Plat forms / iPhoneOS.platform / Developer / usr / bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/ usr / bin:/ bin:/ usr / sbin:/ sbin


/ usr / bin / codesign --force --sign 79640A11C8D22589BD337496ABB8443581513846 --entitlements /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Intermediates/RoyalAppInspection.build/Debug-iphoneos/RoyalAppInspection .build / RoyalAppInspection.app.xcent /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app

79640A11C8D22589BD337496ABB8443581513846:找不到身份命令/ usr / bin / codesign失败,退出代码为1

我不知道如何解决这个问题,因为我已经尝试确保该过程的所有其他方面都正确完成。



我所遇到的一个问题是,当我点击配置文件文件时,它会不开放和添加到librar y不会弹出(我出于某种原因无法访问iphone配置实用程序。)我手动将.mobileprovision文件添加到我的xcode项目中,但我认为这也可能是我的错误来源。



任何人,你能帮忙吗?

解决方案

你几乎是自己做的,但最后你的个人资料似乎有问题。



首先我会推荐一个工具来查看个人资料,以确保它是正确的: )

  • 保存更改



  • <希望其中一个对您有所帮助!






    更新(4/22/16):



    我刚刚找到了关于整个代码签名过程的非常好的解释(这真的值得一读):
    https://www.objc.io/issues/17-security/inside-code-signing/


    I'm currently in the process of submitting my first app to the Apple store. I've completed the following processes

    1. Obtained a developer account
    2. Logged into the Member Center to Create an App ID
    3. Used keychain access to request and receive a distribution certificate
    4. Obtained a provisioning profile using my id and certificate

    When I build the app it runs perfectly in the app simulator and on the actual ipad, however when I switch my app to Archive on iOS Device i have a major code sign error which i've attached below.

    codesign /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app
    cd /Users/Gaby/Desktop/RoyalAppInspection
    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:/usr/bin:/bin:/usr/sbin:/sbin
    
    
    /usr/bin/codesign --force --sign 79640A11C8D22589BD337496ABB8443581513846 --entitlements /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Intermediates/RoyalAppInspection.build/Debug-iphoneos/RoyalAppInspection.build/RoyalAppInspection.app.xcent /Users/Gaby/Library/Developer/Xcode/DerivedData/RoyalAppInspection-dthvtpxadkslqmhkwdpaqkyujscg/Build/Products/Debug-iphoneos/RoyalAppInspection.app
    
    79640A11C8D22589BD337496ABB8443581513846: no identity found Command /usr/bin/codesign failed with exit code 1
    

    I have no idea what to do to fix this, as I've tried to make sure all the other aspects of the process were completed correctly.

    One concern i did have was when i clicked the provisioning profile file it would not open and "add to library" wouldn't pop up (i cannot access iphone configuration utility for some reason.) I manually added the .mobileprovision file to my xcode project but i'm thinking this may also be a source of my error.

    Anyone, can you please help?

    解决方案

    You almost made it on your own, but in the end there seems to be something wrong with your profile.

    First I would recommend a tool to "look inside" the profile to make sure it's the right one: http://furbo.org/2013/11/02/a-quick-look-plug-in-for-provisioning/

    This will just add some more information about the profile, when selecting it in Finder and pressing space (Quick Look).


    Check your Xcode Preferences:

    1. Xcode Perferences (CMD + ,)
    2. Accounts
    3. Select your account on the left
    4. Select view details on the bottom right
    5. Refresh (using the small button on the bottom left)

    Xcode stores the profiles in ~/Library/MobileDevice/Provisioning Profiles

    If your distribution profile is not in there, double click on it.

    Then it should appear in that folder, but with a hashed name, e.g. 1edf8f42-fd1c-48a9-8938-754cdf6f7f41.mobileprovision at this point the Quick Look plugin comes in handy :-)


    Next, check your Project Settings:

    1. select the target (not project) you want to build in Xcode
    2. switch to build settings
    3. look for the "Code Signing" section
    4. check if the correct profile is selected under "Provisioning Profile" => "Release"


    Next, check your Scheme Settings:

    1. select Product menu
    2. open scheme submenu
    3. select edit scheme...
    4. select "Archive" on the left
    5. Build configuration should be set to "Release"


    Next, check the Keychain Access Trust settings:

    1. open keychain access (spotlight => keychain)
    2. select login
    3. click on Certificates
    4. look for iPhone Distribution: Elena Carrasco (8HE2MJLM25) on the right
    5. right click, select "Get Info"
    6. open "Trust" section
    7. set to "Use System Defaults"
    8. repeat steps 5 to 7 for Apple Worldwide Developer Relations Certificate Authority


    Next, check the Keychain Access private key Access Control:

    1. repeat steps 1 to 4 from previous check
    2. expand the profile to make your private key visible
    3. right click on the private key, select "Get Info"
    4. switch to "Access Control"
    5. select "Confirm before allowing access"
    6. use the "+" button to add "codesign" (normally located in /usr/bin/codesign)
      Hint: if it doesn't show up in the file browser, use cmd + shift + g to enter the path manually
    7. when using Carthage: add /usr/bin/productbuild here as well (thx to DesignatedNerd)
    8. "Save Changes"

    Hope one of this does trick for you!


    Update (4/22/16):

    I just found a very nice explanation about the whole code sign process (it's really worth reading): https://www.objc.io/issues/17-security/inside-code-signing/

    这篇关于命令/ usr / bin / codesign失败,退出代码为1-代码符号错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆