1、下載protobuf
使用git的方式到開(kāi)源社區(qū)下載protobuf,在終端種輸入以下命令:
git clone https://github.com/google/protobuf.git
2、安裝brew
ruby -e "$(curl -fsSL ?https://raw.githubusercontent.com/Homebrew/install/master/install)"
3、使用brew安裝protoc
brew install protobuf
4.安裝 automake
brew install automake
brew install libtool
5、將ProtoBuf協(xié)議文件編譯為OC文件
protoc –objc_out=./ ? ?test.proto