# Generate Protocol Buffers files for iOS

> [!NOTE]
> **Note:** These steps were tested using a Mac machine running macOS Big Sur v11.6.

This guide shows you how to generate the [Protocol Buffers](https://developers.google.com/protocol-buffers) source files for iOS from scratch.

### Generate C++ source files from the proto file

1. [Download the Protocol Buffers Compiler v3.18.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.18.0) on your local machine.

2. Unzip it.

3. Check its version:

   ```
   ./bin/protoc --version
   ```

   You should have `libprotoc 3.18.0`.
4. In the Cardboard repository, locate the `proto` folder and save its path.

5. Generate the Protocol Buffers source files in C++:

   ```
   ./bin/protoc --proto_path=$PROTO_FOLDER_PATH --cpp_out=$PROTO_FOLDER_PATH cardboard_device.proto
   ```

   You should now have **cardboard_device.pb.cc** and **cardboard_device.pb.h**.