Xcode編譯時builtin-copy失敗
原因是有檔案存在extended attributes,應該是Xcode指令行的一個bug。
解決方法:去除擴充屬性@
1. 為什麼會有這個@ ?
Headers andyliu$ ls -l
total 32
-rw-r--r--@ 1 andyliu staff 114 Oct 11 19:23 NodeMobile.h
-rw-r--r-- 1 andyliu staff 114 Oct 11 19:22 NodeMobile.x
-rw-r--r-- 1 andyliu staff 114 Oct 11 19:23 NodeMobile.x2
-rw-r--r--@ 1 andyliu staff 114 Oct 11 19:16 NodeMobile.xx
列印某個檔案的擴充屬性:
xattr App.docx
com.apple.FinderInfo
com.apple.lastuseddate#PS
com.apple.metadata:kMDLabel_7tid2fntzxfoopva5vyhyi2omq
com.apple.quarantine
這個擴充屬性是MacOS增加一些額外資訊,跟權限沒有任何關系。
典型的是Finder,Spotlight等為了快速索引和關聯時建立的資訊。
參考這篇文章
2. 如何去除?(去除導緻增加擴充屬性的條件)
-
從spotlight移除
CMD+空格調出Spotlight自己,輸入spotlight打開其配置頁面,切換到Privacy頁面,加入需要禁止的目錄。
- 調出Activity Monitor,找到Finder程序,殺死它。
參考 (不一定有效的方法)
- https://apple.stackexchange.com/questions/87313/how-to-remove-xattr-com-apple-quarantine-from-all-webarchive-files-with-that-ex