google GRPC for Ios Xcode 集成grpc 以及使用

本文档详细介绍了如何在Xcode项目中集成gRPC,并提供了配置cocoaPods、安装protoc编译器、运行服务器和客户端应用的步骤。还分享了作者在创建Xcode工程、编写.podspec文件以及使用.proto文件进行网络请求的实际操作经验。
摘要由CSDN通过智能技术生成

一 grpc 的简介(可参考谷歌http://www.grpc.io/

1.配置可参考http://www.grpc.io/docs/quickstart/objective-c.html

配置要求:

cocoaPods: Version 1.0 or Higher   查看版本 pod --Version

Xcode: version 7.2 or higher    :installed:sh [sudo] xcode-select --instal

Install with Homebrewsh brew install autoconf automake libtool pkg-config

2.配置好这些内容就去下载官网demo

下载:

 $git clone https://github.com/grpc/grpc.git

Install gRPC plugins and libraries:

$cd grpc

$git submodule update--init

$make

$[sudo]make install

Install protoc compiler:

$brew tap grpc/grpc

$brew install google-protobuf


Run the server:

$cd examples/cpp/helloworld

$make

$./greeter_server&


Run the client:

$cd../../objective-c/helloworld

$pod install


Run the client app:

$ openHelloWorld.xcworkspace


3.以上是官网的demo,以下是自己的操作

(1)创建Xcode你的工程。创建.podspec 和   Podfile 

    $ pod spec create iOS_Demo 

这样创建 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值