删除Mac上的应用程序

  1. launchpad上,长按图标,或者按住键盘上三键:control+option+command,如果是通过App Store安装的应用,就可以点❌删除了
  2. 直接进入/Applications/目录去删除应用,这个可以删除内置应用,谨慎操作
  3. 如果是Chrome等的App,需要进入类似如下目录进行删除咯:/Users/gavin/Applications/Chrome Apps.localized
  4. 另外,Launchpad的图标内容存储在类似如下目录结构的数据库中:/private/var/folders/sj/xtcg7hhs40j51rl4xfty_4gr0000gn/0/com.apple.dock.launchpad/db/db,可以通过类似这个命令进行删除图标:sqlite3 db “delete from apps where title=’应用名称’;”&&killall Dock

参考资料:

  1. https://apple.stackexchange.com/questions/174084/how-to-remove-chrome-app-icons-from-launchpad
  2. https://blog.csdn.net/qq_36004521/article/details/80740491
  3. https://jingyan.baidu.com/article/fa4125ac0d5a2c28ac7092e6.html

Mac /var/folders/sj/目录权限问题

Mac上/var/folders/sj/目录权限问题。
由于Mac的System Integrity Protection(SIP),需要重启进入recover 模式(重启之后按住command+r),在工具中找到terminal执行csrutil disable命令,回车,然后重启,SIP保护就被关闭了。
如果要重新打开SIP保护,操作是一样的,命令中的disable换成enable就可以了。
之后就可以:
sudo rm -rf /var/folders/sj/xtcg7hhs40j51rl4xfty_4gr0000gn
chmod -R 777 /var/folders/sj/xtcg7hhs40j51rl4xfty_4gr0000gn/T


参考:
https://apple.stackexchange.com/questions/266821/how-can-i-fix-permissions-for-files-in-the-var-folders-zz
https://blog.csdn.net/tmpbook/article/details/50292475
https://blog.csdn.net/i_lovenet/article/details/80462829


Error Array to string conversion for Yii::$app->user->id

解决方法如下:

  1. ALTER TABLE user ADD PRIMARY KEY(id);
  2. i remove manually from the browser the cookie and it work.

参考:

https://stackoverflow.com/questions/44499961/error-array-to-string-conversion-for-yiiapp-user-id

https://github.com/yiisoft/yii2/issues/1029

https://stackoverflow.com/questions/27681505/login-on-production-server-doesnt-work