模拟器是不需要签名的,今天竟然报签名错误了
报错信息
Command CodeSign failed with a nonzero exit code
详细信息
CodeSign /Users/yoli/Library/Developer/Xcode/DerivedData/test-aigpkmmzosvjhaejgcnaxkhsnbto/Build/Products/Debug-iphonesimulator/test.app (in target: test)
cd /Users/yoli/Desktop/App/test
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --timestamp=none /Users/yoli/Library/Developer/Xcode/DerivedData/test-aigpkmmzosvjhaejgcnaxkhsnbto/Build/Products/Debug-iphonesimulator/test.app
/Users/yoli/Library/Developer/Xcode/DerivedData/test-aigpkmmzosvjhaejgcnaxkhsnbto/Build/Products/Debug-iphonesimulator/test.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/yoli/Library/Developer/Xcode/DerivedData/test-aigpkmmzosvjhaejgcnaxkhsnbto/Build/Products/Debug-iphonesimulator/test.app/Base.lproj
Command CodeSign failed with a nonzero exit code
解决
经过一番折腾最后发现竟然是因为我引入了一个名为Resources的文件夹,改名后正常,经测试黄色文件夹是可以的
心得
当遇到莫名问题的时候,就是报错信息和原因不匹配,要试着退回上一个可运行版本,看看做了哪些操作,当时因为同时还在报个另外的错误,所以第一时间没有找到解决方案