【转载】iOS之使用模拟器报错:resource fork, Finder information, or similar detritus not allowed完美解决方案

真机运行正常,模拟器一直报iOS之使用模拟器报错:resource fork, Finder information, or similar detritus not allowed。详细报错信息见下图。 
这里写图片描述
通过下面一篇文章只能治表不治本,每次启动运行应用时,到要执行:xattr -rc . 
不过确实要赞成作者这样的解决方案都能想到。

现在终于找到原因可以干掉这个问题了。 
报这个错的原因是,工程原来的名称和现在的Bundle Identifier的后缀不一致,我的工程是project的Product Bundle Identifier和Product Module Name为空。见下图: 
这里写图片描述

这里写图片描述

这里写图片描述
那我们不想改工程名和路径,Bundle Identifier怎么办,当然有办法了。 
把工程中需要用到原来的工程名的地方都配置为Bundle Identifier就是了。这样问题就完美解决了,再也不用模拟器运行不起来或每次都执行xattr -rc .了。我是一股脑儿都把它换为Bundle Identifier了,被它搞怕了。当然你只是想偶尔改下Bundle Identifier,运行一下模拟器也可以用哪位大哥的临时方案。 
完美方案见下图: 
这里写图片描述

这里写图片描述

这里写图片描述

临时解决方案: 
http://www.cnblogs.com/LQCQ-Silent/p/6179477.html 
很奇怪的问题,使用真机测试没有问题。但使用模拟器测试的时候就会报这样的错误,错误类型为:Code Sign Error

错误提示是这样:resource fork, Finder information, or similar detritus not allowed。

找了很多资料,说的都是一半一半,有的看了仍是无从下手。最后看到的处理方式是这样的:

首先关闭Xcode,打开终端:

进入DerivedData目录

cd ~/Library/Developer/Xcode/DerivedData/  
然后再终端输入:xattr -rc . 

xattr -rc . 

再次运行项目,就没有这样报错了。(也是对症下药吧,如果不适用就再看其他的方法吧)

报错完整信息: 
CodeSign /Users/jiaguoshang/Library/Developer/Xcode/DerivedData/OutdoorClub-faehbxlmjdryajcjmcwmlhrlxyfa/Build/Products/Debug-iphonesimulator/OutdoorClub.app 
cd /Users/jiaguoshang/Desktop/OutdoorClub-2017-4-24-GoogleMaps 
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate 
export PATH=”/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/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/jiaguoshang/Library/Developer/Xcode/DerivedData/OutdoorClub-faehbxlmjdryajcjmcwmlhrlxyfa/Build/Products/Debug-iphonesimulator/OutdoorClub.app
  • 1
  • 2

/Users/jiaguoshang/Library/Developer/Xcode/DerivedData/OutdoorClub-faehbxlmjdryajcjmcwmlhrlxyfa/Build/Products/Debug-iphonesimulator/OutdoorClub.app: replacing existing signature 
/Users/jiaguoshang/Library/Developer/Xcode/DerivedData/OutdoorClub-faehbxlmjdryajcjmcwmlhrlxyfa/Build/Products/Debug-iphonesimulator/OutdoorClub.app: resource fork, Finder information, or similar detritus not allowed 
Command /usr/bin/codesign failed with exit code 1

posted @ 2017-12-27 09:37  六界剑仙  阅读(526)  评论(0)    收藏  举报