1. 程式人生 > 實用技巧 >如何解決“This app is damaged and can’t be opened. You should move it to the Trash”

如何解決“This app is damaged and can’t be opened. You should move it to the Trash”

  參考資料:

  https://osxdaily.com/2019/02/13/fix-app-damaged-cant-be-opened-trash-error-mac/

  在外網上下了個app,但是打不開,顯示的是如下的圖片:(參考資料裡找的,不過字是一樣的)

  

  解決方法文章裡列了四條,但是前三條是給外行看的:

  1. 重新下載(?...)

  2.重啟(?...)

  3.安裝最新更新(?...)

  看的也是很無語,讓我感覺這篇文章是來搞笑的。


  第四條是使用xattr命令,抱著試一試的態度嘗試了一下,沒想到竟然好了,記錄在此以免忘記,以便查詢。

  方法其實很簡單,在終端裡執行下面一個命令就好了。下面是傻瓜式的過程:  然後在命令列裡輸入如下命令:  執行之後再開啟app,問題應該是解決了。

  總之,關鍵的命令如下:

  Launch Terminal and then issue the following command:

xattr -cr /path/to/application.app

  For example:

xattr -cr /Applications/Signal.app

  The -c flag removes all attributes, whereas -r applies recursively for the entire targeted .app directory contents.

  這個xattr工具的說明可以看這個網頁:https://osxdaily.com/2018/05/03/view-remove-extended-attributes-file-mac/

  大概的功能可能就是關閉了筆記本對該應用的校驗功能吧。