Toit for macOS

Install the Toit CLI

The Toit CLI is used for interacting with the Toit console and your Toit devices.

Download

Unpack

  • Unpack the toit_darwin.tgz file and save the executable file named toit into a folder - for example the Applications folder.

Watch the installation video, if you need guidance.

Add Toit to PATH

To make sure you can run the Toit CLI in a terminal window from any directory, add the Toit executable to your PATH environment variable by editing the shell configuration script.

Depending on the shell you use: edit either the .zshrc file or the .bashrc file.

For example, if you use bash and if you chose to put the toit executable into the Applications folder, execute the following command in a terminal window:

echo 'export PATH=/Applications:$PATH' >> ~/.bashrc;

Check installation

To verify that you have successfully configured the PATH with the toit executable, open a new terminal window and type

toit

The output is a list of all available commands in the Toit CLI.

You may need administrator rights to run toit at the end of the installation process.

Install Visual Studio Code

Toit comes with a language server and provides a Visual Studio Code Language Extension for the Toit programming language.

You can download Visual Studio Code here.

Install language extension

The Toit Language Extension provides built-in language support for the Toit programming language, but also a device view and a serial view from where you can interact directly with your devices.

The Toit language extension also provides helpful commands for the developer, such that you can run or deploy Toit programs on your devices directly from Visual Studio Code.

When you have downloaded and installed Visual Studio Code, get the language extension for Toit either from the Visual Studio marketplace or from the open marketplace.

Configure VSCode

On macOS, you need to configure the VSCode PATH in Visual Studio Code.

Start by launching Visual Studio Code. In the View menu, choose to open the Command Palette.

Type shell command to find the Shell Command: Install 'code' command in PATH.

The Toit Language Extension is currently only supported for Visual Studio Code.