Code Sign Error in macOS Sierra Xcode 8.3.3 - resource fork, Finder information, or similar detritus not allowed

这是iOS 10, macOS Sierra, watchOS 3, 和 tvOS 10带来的安全策略更新。代码签名不再允许应用程序包中的任何文件具有包含资源分叉或查找信息的扩展属性。

通过如下命令行,可以查看那些文件导致了这些问题:

$ xattr -lr <path_to_app_bundle>

解决这一问题的方案大致有三个:

  1. 删除App的资源文件中所有扩展属性

xattr -cr <path_to_app_bundle>

  2. 查找带有finder信息的文件,定向删除

ls -alR@ . > kundapura.txt

  找出com.apple.FinderInfo文件,定向删除扩展属性

xattr -c <filename>

  3. 定向文件类型,删除扩展属性

  find . -type f -name '*.jpeg' -exec xattr -c {} \;
  find . -type f -name '*.jpg' -exec xattr -c {} \;
  find . -type f -name '*.png' -exec xattr -c {} \;
  find . -type f -name '*.json' -exec xattr -c {} \;

 

posted @ 2017-09-30 17:30  optt  阅读(253)  评论(0编辑  收藏  举报