blob: db3bcb18fe717f5fdcaf408a1190ea61e752a2cd [file] [log] [blame] [view]
murgatroid99042b9122015-06-11 14:23:32 -07001#gRPC in 3 minutes (Objective C)
2
3## Installation
4
5To run this example you should have [Cocoapods](https://cocoapods.org/#install) installed, as well as the relevant tools to generate the client library code (and a server in another language, for testing). You can obtain the latter by following [these setup instructions](https://github.com/grpc/homebrew-grpc).
6
7## Hello Objective C gRPC!
8
9Here's how to build and run the Objective C implementation of the [Hello World](https://github.com/grpc/grpc-common/blob/master/protos/helloworld.proto) example used in [Getting started](https://github.com/grpc/grpc-common).
10
11The example code for this and our other examples lives in the `grpc-common`
12GitHub repository. Clone this repository to your local machine by running the
13following command:
14
15
16```sh
17$ git clone https://github.com/grpc/grpc-common.git
18```
19
20Change your current directory to grpc-common/objective-c/HelloWorld
21
22```sh
23$ cd grpc-common/objective-c/HelloWorld
24```
25
26### Try it!
27To try the sample app, we need a gRPC server running locally. Let's compile and run, for example, the C++ server in this repository:
28
29```shell
30$ pushd ../../cpp/helloworld
31$ make
32$ ./greeter_server &
33$ popd
34```
35
36Now have Cocoapods generate and install the client library for our .proto files:
37
38```shell
39$ pod install
40```
41
42This might have to compile OpenSSL, which takes around 15 minutes if Cocoapods doesn't have it yet on your computer's cache).
43
44Finally, open the XCode workspace created by Cocoapods, and run the app. You can check the calling code in `Supporting Files/main.m` and see the results in XCode's log console.
45
46## Tutorial
47
48You can find a more detailed tutorial in [gRPC Basics: Objective C](https://github.com/grpc/grpc-common/blob/master/objective-c/route_guide/README.md)