Where is protoc and how do i install it?

2019-08-18 16:04发布

问题:

I'd like to use the protoc command to generate java files

I've been following the instructions in the README from github https://github.com/protocolbuffers/protobuf but it just tells you to download the zip file and that the "binary" is already included. However, after downloading the latest (and a couple other versions) and unzipping the files, I can't find the "protoc" binary.

Is there some other missing instruction that i'm supposed to follow?

P.S. i'm using Mac OS X

回答1:

Open https://github.com/protocolbuffers/protobuf/releases and look for the binary for 32- or 64-bit OS X:

  • protoc-3.6.1-osx-x86_32.zip
  • protoc-3.6.1-osx-x86_64.zip


回答2:

I had to install it using homebrew

something like this answer: Installing Google Protocol Buffers on mac