I did some testing to come up with a procedure for installing and running Anki from a USB flash drive on Mac computers. This worked for me on an M1 Mac Mini with macOS Tahoe 26.0.1.
Installation:
- Create an
Anki.commandshell script file in the folder on the USB flash drive where you want Anki files installed:
#!/bin/zsh
echo "Starting Anki..."
USB_ROOT=`realpath $0 | sed 's/\/[^/]*$//'`
export ANKI_LAUNCHER_VENV_ROOT=$USB_ROOT/AnkiProgramFiles
export ANKI_LAUNCHER=$USB_ROOT/Anki.app
export ANKI_BASE=$USB_ROOT/AnkiData
open $ANKI_LAUNCHER
- In Terminal, go into the directory with the
Anki.commandfile and runchmod 755 Anki.commandto make the file runnable. - Download the Mac Anki launcher
.dmgfile from apps.ankiweb.net. - Open the
.dmgfile and drag the “Anki” file into the folder that contains theAnki.commandfile (to copy the launcher there). - Double-click the
Anki.commandfile to run it. It will start the launcher (which will open up a blank Terminal window). The launcher menu will eventually appear in the Terminal window. (It may take up to 40-50 seconds for the menu to appear.) - Install Anki from the launcher menu (by pressing the Enter key). It can take up to 10-20 minutes for the many individual Anki components to be downloaded and installed during the process.
- Once the installation is complete, the launcher will automatically start the Anki app.
macOS may ask you for various permissions during the installation process, for example:
- For Terminal to access files on the removable drive
- To allow the Anki launcher (an app downloaded from the internet) to run
- For Anki to access files on the removable drive
Running Anki:
- From now on, you will double-click the
Anki.commandfile whenever you want to run Anki. - A Terminal window will briefly appear and then close when
Anki.commandis run. - The
Anki.commandfile will run the Anki launcher and start the Anki app for you. - Do not run the Anki launcher app (the Anki icon) directly.
- If you accidentally do so, just close/exit the launcher Terminal window when it appears.
Changing the Anki.command icon:
- To make things easier visually in Finder, you can make the
Anki.commandfile’s icon the Anki icon instead of the shell script file icon it normally uses.- In the Get Info windows, copy the icon from the “Anki” app and paste it to
Anki.command’s icon. - See: Customize the look of folders and files on Mac - Apple Support
- In the Get Info windows, copy the icon from the “Anki” app and paste it to
- Similarly, you can change the “Anki” app’s icon to something else, to make it less likely that you accidentally click on it.