iOS远程自动打包签名失败解决

问题表现:
1. 在mac上直接执行脚本正常
2. ssh连到mac机上执行打包到最后阶段报如下错误:

 /usr/bin/codesign --force --sign C4184E1FD4FBE46294B9677365BD1F9D61FD1583 --entitlements /Users/hack/Library/Developer/Xcode/DerivedData/xxxx.app.xcent --timestamp=none
/Users/hack/Library/Developer/Xcode/DerivedData/xxxx.app
SecKey API returned: -25308, (null)/Users/hack/Library/Developer/Xcode/DerivedData/xxxx.app: unknown error -1=ffffffffffffffff
Command /usr/bin/codesign failed with exit code 1
** ARCHIVE FAILED **

解决方法:
在脚本里添加(由于不是永久的,所以放脚本里):

ln -s ~/Library/Keychains/login.keychain-db ~/Library/Keychains/login.keychain
security unlock -p ztsafe ~/Library/Keychains/login.keychain

http://www.jianshu.com/p/b03e59560d31

你可能感兴趣的:(iOS远程自动打包签名失败解决)