当前位置:   article > 正文

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

mac 已损坏打不开您应该将它移到废纸篓

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

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

接着打开文件进行安装。

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

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

sudo spctl  --master-disable

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

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

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

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

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

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

附:

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

  1. usage: xattr [-l] [-r] [-s] [-v] [-x] file [file ...]
  2. xattr -p [-l] [-r] [-s] [-v] [-x] attr_name file [file ...]
  3. xattr -w [-r] [-s] [-x] attr_name attr_value file [file ...]
  4. xattr -d [-r] [-s] attr_name file [file ...]
  5. xattr -c [-r] [-s] file [file ...]
  6. The first form lists the names of all xattrs on the given file(s).
  7. The second form (-p) prints the value of the xattr attr_name.
  8. The third form (-w) sets the value of the xattr attr_name to the string attr_value.
  9. The fourth form (-d) deletes the xattr attr_name.
  10. The fifth form (-c) deletes (clears) all xattrs.
  11. options:
  12. -h: print this help
  13. -l: print long format (attr_name: attr_value and hex output has offsets and
  14. ascii representation)
  15. -r: act recursively
  16. -s: act on the symbolic link itself rather than what the link points to
  17. -v: also print filename (automatic with -r and with multiple files)
  18. -x: attr_value is represented as a hex string for input and output

man xattr命令,解析如下:

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/709328
推荐阅读
相关标签
  

闽ICP备14008679号