升级Xcode8beta4;调试提示:“.app: resource fork, Finder information, or similar detritus not allowed”...

    xiaoxiao2026-10-04  2

    进入工程目录;执行 "xattr -rc .";解决

    同样适用于模拟器调试出现上述错误提示

    延伸阅读

    文件和目录的扩展属性问题

    在 Mac OS X 下,文件经常会被附加上 OS X 特有的扩展属性 ( extend attributes ),具体表现是用 ls -l 查看时会有 @ 的标记,譬如

    $ ls -l os.pdf -rw-r--r--@ 1 cnhavee staff 1518 1 9 14:13 os.pdf

    这个 @ 属性是用户在 Finder 中对文件进行任意操作后就会被附带上,特别讨厌这个属性,这直接导致在 OS X 下打包后放到 Linux 系统分享文件的时候,会出现莫名其妙的错误,兼因 tar 命令本身并不能区分 extend attributes

    还好,Mac OS X 下的 cp 有个选项 -X 能忽略这个扩展属性

    cp: -X do not copy extended attributes (eas) or resource forks.

    处理这个问题,譬如打包,在打包前,请用 cp -Xr 拷贝出一份没有扩展属性的文件或目录,然后再 tar 打包处理。

    另有个命令 xattr 也能做到

    $ xattr -l filename com.apple.ResourceFork: 00000000 00 00 01 00 00 00 05 08 00 00 04 08 00 00 00 32 |...............2| …… $ xattr -d com.apple.ResourceFork filename

    你可以一次性清除一个文件的所有 extend attributes

    $ xattr -c filename

    你也可以对一个目录及其下的所有文件做清除操作

    $ xattr -rc directory 相关资源:python入门教程(PDF版)
    最新回复(0)