[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThis guide provides step-by-step instructions for generating Protocol Buffers source files for iOS, starting with C++ file generation from a proto file.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves downloading and utilizing the Protocol Buffers Compiler, locating the 'proto' folder within the Cardboard repository, and executing specific commands to produce the necessary C++ source files (cardboard_device.pb.cc and cardboard_device.pb.h).\u003c/p\u003e\n"],["\u003cp\u003eThese steps were tested on a Mac running macOS Big Sur v11.6 and require Protocol Buffers Compiler v3.18.0.\u003c/p\u003e\n"]]],[],null,["# Generate Protocol Buffers files for iOS\n\n| **Note:** These steps were tested using a Mac machine running macOS Big Sur v11.6.\n\nThis guide shows you how to generate the [Protocol Buffers](https://developers.google.com/protocol-buffers) source files for iOS from scratch.\n\n### Generate C++ source files from the proto file\n\n1. [Download the Protocol Buffers Compiler v3.18.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.18.0) on your local machine.\n\n2. Unzip it.\n\n3. Check its version:\n\n ```\n ./bin/protoc --version\n ```\n\n You should have `libprotoc 3.18.0`.\n4. In the Cardboard repository, locate the `proto` folder and save its path.\n\n5. Generate the Protocol Buffers source files in C++:\n\n ```\n ./bin/protoc --proto_path=$PROTO_FOLDER_PATH --cpp_out=$PROTO_FOLDER_PATH cardboard_device.proto\n ```\n\n You should now have **cardboard_device.pb.cc** and **cardboard_device.pb.h**."]]