mac上,『已损坏,无法打开。 您应该将它移到废纸篓』的恶心玩意怎么解决

2024-06-04 3525阅读

一、允许“任何来源”开启

M1 mac打开【系统偏好设置】,选择【安全性与隐私】可以看到【任何来源】已经选定。

mac上,『已损坏,无法打开。 您应该将它移到废纸篓』的恶心玩意怎么解决 第1张

接着打开文件进行安装

如果没有看到“任何来源”的选项,如果不开启“任何来源”的选项,会直接影响到无法运行的第三方应用。开启“任何来源”的方法如下:

【启动台】,选择【终端】,如下图所示:

sudo spctl  --master-disable

然后回车,继续输入密码,然后回车。再重新打开【系统偏好设置】,选择【安全性与隐私】。

二、如果显示为『任何来源』但还是显示“已损坏,无法打开。 您应该将它移到废纸篓”,要用这种方法:

打开 “访达”(Finder)进入 “应用程序” 目录,找到该软件图标,将图标拖到刚才的终端窗口里面,会得到如下组合(如图所示):

sudo xattr -r -d com.apple.quarantine /Applications/WebStrom.app

mac上,『已损坏,无法打开。 您应该将它移到废纸篓』的恶心玩意怎么解决 第2张

回到终端窗口按回车,输入系统密码回车即可。

接着重新打开安装软件,就可以正常安装了。

附:

macOS 支持使用类似 Linux 的 API 从文件或目录中列出、 获取、设置、和删除扩展属性。在命令行中,这些能力通过xattr实用程序公开。xattr  usage使用如下:

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 ...]
The first form lists the names of all xattrs on the given file(s).
The second form (-p) prints the value of the xattr attr_name.
The third form (-w) sets the value of the xattr attr_name to the string attr_value.
The fourth form (-d) deletes the xattr attr_name.
The fifth form (-c) deletes (clears) all xattrs.
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

man xattr命令,解析如下:

man xattr
NAME
     xattr – display and manipulate extended attributes
SYNOPSIS
     xattr [-lrsvx] file ...
     xattr -p [-lrsvx] attr_name file ...
     xattr -w [-rsx] attr_name attr_value file ...
     xattr -d [-rsv] attr_name file ...
     xattr -c [-rsv] file ...
     xattr -h | --help
DESCRIPTION
     The xattr command can be used to display, modify or remove the extended attributes of one or more files, including
     directories and symbolic links.  Extended attributes are arbitrary metadata stored with a file, but separate from the
     filesystem attributes (such as modification time or file size).  The metadata is often a null-terminated UTF-8 string,
     but can also be arbitrary binary data.
     One or more files may be specified on the command line.  For the first two forms of the command, when there are more
     than one file, the file name is displayed along with the actual results.  When only one file is specified, the display
     of the file name is usually suppressed (unless the -v option described below, is also specified).
     In the first form of the command (without any other mode option specified), the names of all extended attributes are
     listed.  Attribute names can also be displayed using “ls -l@”.
     In the second form, using the -p option (“print”), the value associated with the given attribute name is displayed.
     Attribute values are usually displayed as strings.  However, if nils are detected in the data, the value is displayed
     in a hexadecimal representation.
     The third form, with the -w option (“write”), causes the given attribute name to be assigned the given value.
     The fourth form, with the -d option (“delete”), causes the given attribute name (and associated value), to be removed.
     In the fifth form, with the -c option (“clear”), causes all attributes (including their associated values), to be
     removed.
     Finally, the last form, with either the -h or --help option, displays a short help message and exits immediately.
OPTIONS
     -l  By default, the first two command forms either displays just the attribute names or values, respectively.  The -l
         option causes both the attribute names and corresponding values to be displayed.  For hexadecimal display of
         values, the output is preceeded with the hexadecimal offset values and followed by ASCII display, enclosed by “|”.
     -r  If a file argument is a directory, act as if the entire contents of the directory recursively were also specified
         (so that every file in the directory tree is acted upon).
     -s  If a file argument is a symbolic link, act on the symbolic link itself, rather than the file that the symbolic
         link points at.
     -v  Force the file name to be displayed, even for a single file.
     -x  Force the attribute value to be displayed in the hexadecimal representation.
         The -w option normally assumes the input attribute value is a string.  Specifying the -x option causes xattr to
         expect the input in hexadecimal (whitespace is ignored).  The xxd(1) command can be used to create hexadecimal
         representations from exising binary data, to pass to xattr.
EXIT STATUS
     The xattr command exits with zero status on success.  On error, non-zero is returned, and an error message is printed
     to the standard error.  For system call errors, both the error code and error string are printed (see getxattr(2),
     listxattr(2), removexattr(2) and setxattr(2) for a complete list of possible error codes).
     Some attribute data may have a fixed length that is enforced by the system.  For example,
           % xattr -w com.apple.FinderInfo 0 foo
           xattr: [Errno 34] Result too large: 'foo'
     The com.apple.FinderInfo attribute must be 32 bytes in length.
EXAMPLES
     This example copies the com.apple.FinderInfo attribute from the /usr directory to the MyDir directory:
           % xattr -px com.apple.FinderInfo /usr
           00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00
           00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
           % xattr -l MyDir
 % xattr -wx com.apple.FinderInfo \
             "`xattr -px com.apple.FinderInfo /usr`" MyDir
           % xattr -l MyDir
           com.apple.FinderInfo:
           00000000  00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  |........@.......|
           00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
           00000020
SEE ALSO
     ls(1), xxd(1), getxattr(2), listxattr(2), removexattr(2), setxattr(2)
macOS 13.5                                           November 29, 2010     

    免责声明:我们致力于保护作者版权,注重分享,被刊用文章因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理! 部分文章是来自自研大数据AI进行生成,内容摘自(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供学习参考,不准确地方联系删除处理! 图片声明:本站部分配图来自人工智能系统AI生成,觅知网授权图片,PxHere摄影无版权图库和百度,360,搜狗等多加搜索引擎自动关键词搜索配图,如有侵权的图片,请第一时间联系我们,邮箱:ciyunidc@ciyunshuju.com。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!

    目录[+]