ios - Xcode 8 无法存档 "Command/usr/bin/codesign faile

我在 macOS Sierra 上的 Xcode 8 上遇到了一个严重问题。 当我尝试构建我的应用程序时,我遇到了以下问题。

CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app
cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode
export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/me/Downloads/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "-"

/usr/bin/codesign --force --sign - --timestamp=none /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app

/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

然后我做了https://forums.developer.apple.com/thread/48905在终端中如下所示,它起作用了。但是一旦我清理干净,问题又回来了。

cd /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp

ls -al@ *

xattr -c *

并且此解决方案不适用于具有以下问题的存档。有什么解决办法吗?

CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode
export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/me/Downloads/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: My Name (**********)"
Provisioning Profile: "iOS Team Provisioning Profile: com.**********.*********"
                  (********-****-****-****-************)

/usr/bin/codesign --force --sign **************************************** --entitlements /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.app.xcent --timestamp=none /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app

/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

最佳答案

我在 Apple 论坛中找到了这个解决方案

cd ~/Library/Developer/Xcode/DerivedData
xattr -rc .

xattr -rc ~/Library/Developer/Xcode/DerivedData

关于ios - Xcode 8 无法存档 "Command/usr/bin/codesign failed with exit code 1",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39449665/

相关文章:

java - 项目的 POM 丢失,没有可用的依赖信息

Xcode - 如何查看构建命令和日志?

macos - xcode4:链接器错误:找不到选项的目录

xcode4 - Xcode 自定义构建配置导致静态库出现 "library/file not fo

java - Maven 编译器插件总是将一组源检测为 "stale"

windows - 执行 : "gcc": executable file not found in

java - eclipse 中 "Build Automatically"选项的用途

ios - React-native:如何从 Windows 构建 ios

c# - 如何强制 VS 2010 跳过未更改的项目的 "builds"?

.net - 复制本地如何工作? log4net.dll 没有被复制到 MyProject 输出目录