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

/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

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值