The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simulator.
This gist was adapted from the original at https://gist.github.com/BennettSmith/7150245, further adapted from https://gist.github.com/petewarden/c8d172709018780eb069 and updated to deal with iPhone Simulator - i386 issues when building on >=Sierra, and download protobuf version 3.6.1.