目录

Mac 版 Anki 安装 AnkiConnect 插件后连接失败解决方法

目录

MAC上AnkiConnect连接失败问题处理

  • State “DONE” from “STARTED” [2020-07-26 周日 09:16]
  • State “STARTED” from “TODO” [2020-07-26 周日 09:16]

使用 Chrome 上的 Anki 取词插件时,将单词添加至新卡片的功能需要依靠 AnkiConnect 插件连接桌面客户端与取词插件。 由于 Mac 系统的机制,会导致 Anki 客户端处于后台时,AnkiConnect 的进程被挂起。 结果是取词插件设置页面检测不到 AnkiConnect,或者检测到并设置好后短时间内连接又断开。

打开终端执行下面三行命令

defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
defaults write net.ichi2.anki NSAppSleepDisabled -bool true
defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true

重启 Anki 客户端

官方文档原文: Notes for Mac OS X Users Starting with Mac OS X Mavericks, a feature named App Nap has been introduced to the operating system. This feature causes certain applications which are open (but not visible) to be placed in a suspended state. As this behavior causes AnkiConnect to stop working while you have another window in the foreground, App Nap should be disabled for Anki:

Start the Terminal application.

Execute the following commands in the terminal window:

defaults write net.ankiweb.dtop NSAppSleepDisabled -bool true
defaults write net.ichi2.anki NSAppSleepDisabled -bool true
defaults write org.qt-project.Qt.QtWebEngineCore NSAppSleepDisabled -bool true

Restart Anki.