“App can’t be opened because it is from an unidentified developer” 的解决之道?

解决方案

关于 com.apple.quarantine
com.apple.quarantine—Tagging files downloaded from the Internet as possibly untrustworthy, storing the application used to download them, among other things.

当打开没有签名的 Mac 应用时,可能会报 “App can’t be opened because it is from an unidentified developer” 的错误。这种安全机制叫做 GateKeeper。
删除这个属性,就可以去除app 的隔离性,实现打开软件。

$ xattr -d  com.apple.quarantine targetapp

 

xattr 命令简介

xattr – display and manipulate extended attributes

xattr 命令用于展示和修改扩展属性;
个人认为 xattr 可以看做是 extend 和 attributes 的缩写。

 

什么是扩展属性?

扩展属性是与文件一起存储的任意元数据,但与文件系统属性(如修改时间或文件大小)是分开的。
元数据通常是以null结尾的UTF-8字符串,但也可以是任意二进制数据。

有哪些扩展属性,都代表什么意思?

常见用法

$ xattr -h
usage: xattr [-l] [-r] [-s] [-v] [-x] file [file ...]  # 列举给定文件的所有属性名
       xattr -p [-l] [-r] [-s] [-v] [-x] attr_name file [file ...]  #  查看属性对应的值
       xattr -w [-r] [-s] [-x] attr_name attr_value file [file ...] # 设置属性键对应的值(字符串类型)
       xattr -d [-r] [-s] attr_name file [file ...] # 删除一个属性
       xattr -c [-r] [-s] file [file ...]  # 删除所有属性
 
options: 
  -h: print this help
  -l: print long format (attr_name: attr_value and hex output has offsets and ascii representation)
  -r: act recursively  # 以递归方式
  -s: act on the symbolic link itself rather than what the link points to
  -v: also print filename (automatic with -r and with multiple files)
  -x: attr_value is represented as a hex string for input and output

原文链接:https://blog.csdn.net/lovechris00/article/details/113060237

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值