protocol_buffers簡易操做

最近使用CocoaPods來添加第三方類庫,不管是執行pod install仍是pod update都卡在了Analyzing dependencies不動 緣由在於當執行以上兩個命令的時候會升級CocoaPods的spec倉庫,加一個參數能夠省略這一步,而後速度就會提高很多。加參數的命令以下: pod install --verbose --no-repo-update pod update --verbose --no-repo-update 版本 for ios && swift -> ProtocolBuffers (1.9.8)    Protocol Buffers for Objective-C    pod 'ProtocolBuffers', '~> 1.9.8'    - Homepage: http://protobuf.io#objc    - Source:   https://github.com/alexeyxo/protobuf-objc.git    - Versions: 1.9.8, 1.9.7, 1.9.6, 1.9.5, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9,    1.2.2, 1.2.1, 1.2 [master repo] -> ProtocolBuffers-Swift (2.0)    Protocol Buffers for Swift    pod 'ProtocolBuffers-Swift', '~> 2.0'    - Homepage: http://protobuf.io#swift    - Source:   https://github.com/alexeyxo/protobuf-swift.git    - Versions: 2.0, 1.6.2, 1.6.1, 1.6, 1.5.2, 1.5.1, 1.5, 1.4 [master repo] jamie:~ jamie$ Protocol Buffers for Objective-C       An implementation of Protocol Buffers in Objective C. Protocol Buffers are a way of encoding structured data in an efficient yet extensible format. This project is based on an implementation of Protocol Buffers from Google. See the Google protobuf project for more information. This fork contains only ARC version of library. How To Install Protobuf Building the Objective-C Protobuf compiler 1. Check if you have Homebrew brew -v 2. If you don't already have Homebrew, then install it ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 3. Install the main Protobuf compiler and required tools brew install automake brew install libtool brew install protobuf 4. (optional) Create a symlink to your Protobuf compiler. ln -s /usr/local/Cellar/protobuf/2.6.1/bin/protoc /usr/local/bin 5. Clone this repository. git clone https://github.com/alexeyxo/protobuf-objc.git 6. Build it! ./scripts/build.sh Adding to your project as a sub project ... 1. Add /src/runtime/ProtocolBuffers.xcodeproj in your project. Adding to your project as a CocoaPod ... 1. cd <your .xcodeproj directory> 2. echo -e "platform :ios , 6.0 \nlink_with '<YourAppTarget>', '<YourAppTarget_Test>' \npod 'ProtocolBuffers'" > Podfile 3. pod install Compile ".proto" files. protoc --plugin=/usr/local/bin/protoc-gen-objc person.proto --objc_out="./"
相關文章
相關標籤/搜索