Skip to content

macOS installation

Olivier Michel edited this page Oct 27, 2022 · 24 revisions

Prerequisites Packages

Install Homebrew

Follow the installation instructions from there: https://brew.sh Note: When installing Brew, the XCode Command Line Tools are also installed.

And then install the following packages:

brew install cmake swig wget protobuf

Clone the Github Repository

From a Terminal app, create the development directory in your home directory and clone the repository.

Note: instead of cloning https://github.com/cyberbotics/webots.git, we recommend to create your own fork and clone it, so that you can commit your changes directly on it.

git config --global credential.helper store
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global push.default simple
git clone --recurse-submodules -j8 https://github.com/cyberbotics/webots.git
cd webots

Git Submodules

If you cloned Webots with the --recurse-submodules option, you can skip this step. Otherwise, you need to initialize the submodules used by Webots:

git submodule init
git submodule update

Setup your Bash Profile

Check the content of scripts/install/bash_profile.mac and append it at the end of your ~/.bash_profile:

cat scripts/install/bash_profile.mac >> ~/.bash_profile
cat scripts/install/bash_profile.mac >> ~/.zprofile
source ~/.bash_profile

Install Optional Dependencies [ optional ]

If needed, follow these instructions to install optional dependencies.

Build Webots

Compile Webots and automatically download the required resources in the dependencies folder:

make -jX

Note: X represents the number of threads for a speedy multi-threaded compilation. For example, type make -j12 on a CPU with four cores and hyper-threading.

make help displays additional targets for debugging, profiling, cleaning, etc.

Once compiled, type ./webots to launch it.

Clone this wiki locally