Merge pull request #7363 from stanley-cheung/php-prepare-for-ga-v1_0branch

php: prepare for GA release
diff --git a/.travis.yml b/.travis.yml
index 7576e07..4cdad37 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,5 @@
+git:
+  depth: 1
 language: objective-c
 osx_image: xcode7.3
 env:
@@ -14,7 +16,7 @@
     - SCHEME="InteropTestsLocalCleartext" WORKSPACE="Tests.xcworkspace"
       TEST_PATH="src/objective-c/tests"  BUILD_ONLY="false"
       INTEROP_SERVER="true"
-    # TODO(jcanizales): Investigate why they time out:
+    # TODO(jcanizales): Make tests an app project (instead of library), so the following will work.
     # - SCHEME="InteropTestsRemote" WORKSPACE="Tests.xcworkspace"
     #   TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
     #   INTEROP_SERVER="true"
@@ -34,15 +36,15 @@
       TEST_PATH="src/objective-c/examples/SwiftSample" BUILD_ONLY="true"
       INTEROP_SERVER="false"
 before_install:
+  # Until Travis upgrades from Cocoapods 0.39, we need to do it here.
   - pod --version
   - gem uninstall cocoapods -a
-  - gem install cocoapods -v '1.0.0'
+  - gem install cocoapods -v '1.0.1'
   - pod --version
+  # Recent pods aren't found if we don't explicitly update Cocoapods' repo.
+  - pod repo update
   - brew install gflags
 install:
-  - make grpc_objective_c_plugin
-  - install bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc
-  - install bins/opt/protobuf/protoc /usr/local/bin/protoc
   - pushd $TEST_PATH
   - pod install
   - popd
diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in
index 175a47f..96bcdb5 100644
--- a/PYTHON-MANIFEST.in
+++ b/PYTHON-MANIFEST.in
@@ -7,7 +7,7 @@
 graft third_party/boringssl
 graft third_party/nanopb
 graft third_party/zlib
-include src/python/grpcio/build.py
+include src/python/grpcio/_unixccompiler_patch.py
 include src/python/grpcio/commands.py
 include src/python/grpcio/grpc_version.py
 include src/python/grpcio/grpc_core_dependencies.py
diff --git a/examples/objective-c/auth_sample/AuthTestService.podspec b/examples/objective-c/auth_sample/AuthTestService.podspec
index d246653..af5ef28 100644
--- a/examples/objective-c/auth_sample/AuthTestService.podspec
+++ b/examples/objective-c/auth_sample/AuthTestService.podspec
@@ -13,27 +13,51 @@
   # Base directory where the .proto files are.
   src = "../../protos"
 
-  # Directory where the generated files will be placed.
-  dir = "Pods/" + s.name
-
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+  s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+  # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
+  pods_root = 'Pods'
+
+  # Path where Cocoapods downloads protoc and the gRPC plugin.
+  protoc_dir = "#{pods_root}/!ProtoCompiler"
+  protoc = "#{protoc_dir}/protoc"
+  plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
+  # Directory where the generated files will be placed.
+  dir = "#{pods_root}/#{s.name}"
+
   s.prepare_command = <<-CMD
     mkdir -p #{dir}
-    protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/auth_sample.proto
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=#{dir} \
+        --grpc_out=#{dir} \
+        -I #{src} \
+        -I #{protoc_dir} \
+        #{src}/auth_sample.proto
   CMD
 
+  # Files generated by protoc
   s.subspec "Messages" do |ms|
     ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
     ms.header_mappings_dir = dir
     ms.requires_arc = false
-    ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+    # The generated files depend on the protobuf runtime.
+    ms.dependency "Protobuf"
+    # This is needed by all pods that depend on Protobuf:
+    ms.pod_target_xcconfig = {
+      'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+    }
   end
 
+  # Files generated by the gRPC plugin
   s.subspec "Services" do |ss|
     ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
     ss.header_mappings_dir = dir
     ss.requires_arc = true
-    ss.dependency "gRPC", "~> 0.12"
+    # The generated files depend on the gRPC runtime, and on the files generated by protoc.
+    ss.dependency "gRPC-ProtoRPC"
     ss.dependency "#{s.name}/Messages"
   end
 end
diff --git a/examples/objective-c/auth_sample/Podfile b/examples/objective-c/auth_sample/Podfile
index 32157a9..a25d20f 100644
--- a/examples/objective-c/auth_sample/Podfile
+++ b/examples/objective-c/auth_sample/Podfile
@@ -3,44 +3,10 @@
 
 install! 'cocoapods', :deterministic_uuids => false
 
-# Location of gRPC's repo root relative to this file.
-GRPC_LOCAL_SRC = '../../..'
-
 target 'AuthSample' do
   # Depend on the generated AuthTestService library.
   pod 'AuthTestService', :path => '.'
 
   # Depend on Google's OAuth2 library
   pod 'Google/SignIn'
-
-  # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
-  # lines in your application.
-  pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
-  pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
-  pod 'gRPC', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-ProtoRPC',  :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
-  # This is the gRPC-Core podspec object, as initialized by its podspec file.
-  grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
-  # Copied from gRPC-Core.podspec, except for the adjusted src_root:
-  src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
-  grpc_core_spec.pod_target_xcconfig = {
-    'GRPC_SRC_ROOT' => src_root,
-    'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
-    'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
-    # If we don't set these two settings, `include/grpc/support/time.h` and
-    # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
-    # build.
-    'USE_HEADERMAP' => 'NO',
-    'ALWAYS_SEARCH_USER_PATHS' => 'NO',
-  }
 end
diff --git a/examples/objective-c/helloworld/HelloWorld.podspec b/examples/objective-c/helloworld/HelloWorld.podspec
index 17b016b..bce6cd5 100644
--- a/examples/objective-c/helloworld/HelloWorld.podspec
+++ b/examples/objective-c/helloworld/HelloWorld.podspec
@@ -13,27 +13,51 @@
   # Base directory where the .proto files are.
   src = "../../protos"
 
-  # Directory where the generated files will be placed.
-  dir = "Pods/" + s.name
-
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+  s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+  # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
+  pods_root = 'Pods'
+
+  # Path where Cocoapods downloads protoc and the gRPC plugin.
+  protoc_dir = "#{pods_root}/!ProtoCompiler"
+  protoc = "#{protoc_dir}/protoc"
+  plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
+  # Directory where the generated files will be placed.
+  dir = "#{pods_root}/#{s.name}"
+
   s.prepare_command = <<-CMD
     mkdir -p #{dir}
-    protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/helloworld.proto
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=#{dir} \
+        --grpc_out=#{dir} \
+        -I #{src} \
+        -I #{protoc_dir} \
+        #{src}/helloworld.proto
   CMD
 
+  # Files generated by protoc
   s.subspec "Messages" do |ms|
     ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
     ms.header_mappings_dir = dir
     ms.requires_arc = false
-    ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+    # The generated files depend on the protobuf runtime.
+    ms.dependency "Protobuf"
+    # This is needed by all pods that depend on Protobuf:
+    ms.pod_target_xcconfig = {
+      'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+    }
   end
 
+  # Files generated by the gRPC plugin
   s.subspec "Services" do |ss|
     ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
     ss.header_mappings_dir = dir
     ss.requires_arc = true
-    ss.dependency "gRPC", "~> 0.12"
+    # The generated files depend on the gRPC runtime, and on the files generated by protoc.
+    ss.dependency "gRPC-ProtoRPC"
     ss.dependency "#{s.name}/Messages"
   end
 end
diff --git a/examples/objective-c/helloworld/Podfile b/examples/objective-c/helloworld/Podfile
index e1bb4dd..0c3feaa 100644
--- a/examples/objective-c/helloworld/Podfile
+++ b/examples/objective-c/helloworld/Podfile
@@ -3,41 +3,7 @@
 
 install! 'cocoapods', :deterministic_uuids => false
 
-# Location of gRPC's repo root relative to this file.
-GRPC_LOCAL_SRC = '../../..'
-
 target 'HelloWorld' do
   # Depend on the generated HelloWorld library.
   pod 'HelloWorld', :path => '.'
-
-  # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
-  # lines in your application.
-  pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
-  pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
-  pod 'gRPC', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-ProtoRPC',  :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
-  # This is the gRPC-Core podspec object, as initialized by its podspec file.
-  grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
-  # Copied from gRPC-Core.podspec, except for the adjusted src_root:
-  src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
-  grpc_core_spec.pod_target_xcconfig = {
-    'GRPC_SRC_ROOT' => src_root,
-    'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
-    'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
-    # If we don't set these two settings, `include/grpc/support/time.h` and
-    # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
-    # build.
-    'USE_HEADERMAP' => 'NO',
-    'ALWAYS_SEARCH_USER_PATHS' => 'NO',
-  }
 end
diff --git a/examples/objective-c/route_guide/Podfile b/examples/objective-c/route_guide/Podfile
index 943f546..b77eb1b 100644
--- a/examples/objective-c/route_guide/Podfile
+++ b/examples/objective-c/route_guide/Podfile
@@ -3,41 +3,7 @@
 
 install! 'cocoapods', :deterministic_uuids => false
 
-# Location of gRPC's repo root relative to this file.
-GRPC_LOCAL_SRC = '../../..'
-
 target 'RouteGuideClient' do
   # Depend on the generated RouteGuide library.
   pod 'RouteGuide', :path => '.'
-
-  # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
-  # lines in your application.
-  pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
-
-  pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-
-  pod 'gRPC', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
-  pod 'gRPC-ProtoRPC',  :path => GRPC_LOCAL_SRC
-end
-
-# This pre_install hook is only needed to use the local version of gRPC-Core. You don't need it in
-# your application.
-pre_install do |installer|
-  # This is the gRPC-Core podspec object, as initialized by its podspec file.
-  grpc_core_spec = installer.pod_targets.find{|t| t.name == 'gRPC-Core'}.root_spec
-
-  # Copied from gRPC-Core.podspec, except for the adjusted src_root:
-  src_root = "$(PODS_ROOT)/../#{GRPC_LOCAL_SRC}"
-  grpc_core_spec.pod_target_xcconfig = {
-    'GRPC_SRC_ROOT' => src_root,
-    'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
-    'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
-    # If we don't set these two settings, `include/grpc/support/time.h` and
-    # `src/core/lib/support/string.h` shadow the system `<time.h>` and `<string.h>`, breaking the
-    # build.
-    'USE_HEADERMAP' => 'NO',
-    'ALWAYS_SEARCH_USER_PATHS' => 'NO',
-  }
 end
diff --git a/examples/objective-c/route_guide/RouteGuide.podspec b/examples/objective-c/route_guide/RouteGuide.podspec
index 97a61ff..e213250 100644
--- a/examples/objective-c/route_guide/RouteGuide.podspec
+++ b/examples/objective-c/route_guide/RouteGuide.podspec
@@ -13,27 +13,51 @@
   # Base directory where the .proto files are.
   src = "../../protos"
 
-  # Directory where the generated files will be placed.
-  dir = "Pods/" + s.name
-
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+  s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+  # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
+  pods_root = 'Pods'
+
+  # Path where Cocoapods downloads protoc and the gRPC plugin.
+  protoc_dir = "#{pods_root}/!ProtoCompiler"
+  protoc = "#{protoc_dir}/protoc"
+  plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
+  # Directory where the generated files will be placed.
+  dir = "#{pods_root}/#{s.name}"
+
   s.prepare_command = <<-CMD
     mkdir -p #{dir}
-    protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/route_guide.proto
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=#{dir} \
+        --grpc_out=#{dir} \
+        -I #{src} \
+        -I #{protoc_dir} \
+        #{src}/route_guide.proto
   CMD
 
+  # Files generated by protoc
   s.subspec "Messages" do |ms|
     ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
     ms.header_mappings_dir = dir
     ms.requires_arc = false
-    ms.dependency "Protobuf", "~> 3.0.0-alpha-4"
+    # The generated files depend on the protobuf runtime.
+    ms.dependency "Protobuf"
+    # This is needed by all pods that depend on Protobuf:
+    ms.pod_target_xcconfig = {
+      'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+    }
   end
 
+  # Files generated by the gRPC plugin
   s.subspec "Services" do |ss|
     ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
     ss.header_mappings_dir = dir
     ss.requires_arc = true
-    ss.dependency "gRPC", "~> 0.12"
+    # The generated files depend on the gRPC runtime, and on the files generated by protoc.
+    ss.dependency "gRPC-ProtoRPC"
     ss.dependency "#{s.name}/Messages"
   end
 end
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index 5aae753..e2dd463 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -1772,6 +1772,7 @@
 static void parsing_action(grpc_exec_ctx *exec_ctx, void *arg,
                            grpc_error *error) {
   grpc_chttp2_transport *t = arg;
+  grpc_error *err = GRPC_ERROR_NONE;
   GPR_TIMER_BEGIN("reading_action.parse", 0);
   size_t i = 0;
   grpc_error *errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
@@ -1780,15 +1781,13 @@
     errors[1] = grpc_chttp2_perform_read(exec_ctx, &t->parsing,
                                          t->read_buffer.slices[i]);
   };
-  if (i != t->read_buffer.count) {
+  if (errors[1] == GRPC_ERROR_NONE) {
+    err = GRPC_ERROR_REF(error);
+  } else {
     errors[2] = try_http_parsing(exec_ctx, t);
+    err = GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
+                                        GPR_ARRAY_SIZE(errors));
   }
-  grpc_error *err =
-      errors[0] == GRPC_ERROR_NONE && errors[1] == GRPC_ERROR_NONE &&
-              errors[2] == GRPC_ERROR_NONE
-          ? GRPC_ERROR_NONE
-          : GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
-                                          GPR_ARRAY_SIZE(errors));
   for (i = 0; i < GPR_ARRAY_SIZE(errors); i++) {
     GRPC_ERROR_UNREF(errors[i]);
   }
diff --git "a/src/objective-c/\041ProtoCompiler-gRPCPlugin.podspec" "b/src/objective-c/\041ProtoCompiler-gRPCPlugin.podspec"
new file mode 100644
index 0000000..72cadb9
--- /dev/null
+++ "b/src/objective-c/\041ProtoCompiler-gRPCPlugin.podspec"
@@ -0,0 +1,122 @@
+# CocoaPods podspec for the gRPC Proto Compiler Plugin
+
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Pod::Spec.new do |s|
+  # This pod is only a utility that will be used by other pods _at install time_ (not at compile
+  # time). Other pods can access it in their `prepare_command` script, under <pods_root>/<pod name>.
+  # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an
+  # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
+  # before them.
+  s.name     = '!ProtoCompiler-gRPCPlugin'
+  v = '0.14.0'
+  s.version  = v
+  s.summary  = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
+  s.description = <<-DESC
+    This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use
+    it in their invocation of protoc, as part of their prepare_command.
+    The generated code will have a dependency on the gRPC Objective-C Proto runtime of the same
+    version. The runtime can be obtained as the "gRPC-ProtoRPC" pod.
+  DESC
+  s.homepage = 'http://www.grpc.io'
+  s.license  = {
+    :type => 'New BSD',
+    :text => <<-LICENSE
+      Copyright 2015, Google Inc.
+      All rights reserved.
+
+      Redistribution and use in source and binary forms, with or without
+      modification, are permitted provided that the following conditions are
+      met:
+
+          * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+          * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following disclaimer
+      in the documentation and/or other materials provided with the
+      distribution.
+          * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+    LICENSE
+  }
+  s.authors  = { 'The gRPC contributors' => 'grpc-packages@google.com' }
+
+  repo = 'grpc/grpc'
+  release = 'release-0_14_1'
+  file = "grpc_objective_c_plugin-#{v}-macos-x86_64.zip"
+  s.source = {
+    :http => "https://github.com/#{repo}/releases/download/#{release}/#{file}",
+    # TODO(jcanizales): Add sha1 or sha256
+    # :sha1 => '??',
+  }
+
+  repo_root = '../..'
+  plugin = 'grpc_objective_c_plugin'
+
+  s.preserve_paths = plugin
+
+  # Restrict the protoc version to the one supported by this plugin.
+  s.dependency '!ProtoCompiler', '3.0.0-beta-3.1'
+  # For the Protobuf dependency not to complain:
+  s.ios.deployment_target = '7.1'
+  s.osx.deployment_target = '10.9'
+  # Restrict the gRPC runtime version to the one supported by this plugin.
+  s.dependency 'gRPC-ProtoRPC', v
+
+  # This is only for local development of the plugin: If the Podfile brings this pod from a local
+  # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be
+  # present in this pod's directory. We use that knowledge to check for the existence of the file
+  # and, if absent, compile the plugin from the local sources.
+  s.prepare_command = <<-CMD
+    if [ ! -f #{plugin} ]; then
+      cd #{repo_root}
+      # This will build the plugin and put it in #{repo_root}/bins/opt.
+      #
+      # TODO(jcanizales): I reckon make will try to use locally-installed libprotoc (headers and
+      # library binary) if found, which _we do not want_. Find a way for this to always use the
+      # sources in the repo.
+      make #{plugin}
+      cd -
+    fi
+  CMD
+end
diff --git "a/src/objective-c/\041ProtoCompiler.podspec" "b/src/objective-c/\041ProtoCompiler.podspec"
new file mode 100644
index 0000000..5e59b25
--- /dev/null
+++ "b/src/objective-c/\041ProtoCompiler.podspec"
@@ -0,0 +1,136 @@
+# Proto Compiler CocoaPods podspec
+
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Pod::Spec.new do |s|
+  # This pod is only a utility that will be used by other pods _at install time_ (not at compile
+  # time). Other pods can access it in their `prepare_command` script, under <pods_root>/<pod name>.
+  # Because CocoaPods installs pods in alphabetical order, beginning this pod's name with an
+  # exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
+  # before them.
+  s.name     = '!ProtoCompiler'
+  v = '3.0.0-beta-3.1'
+  s.version  = v
+  s.summary  = 'The Protobuf Compiler (protoc) generates Objective-C files from .proto files'
+  s.description = <<-DESC
+    This podspec only downloads protoc so that local pods generating protos can execute it as part
+    of their prepare_command.
+    The generated code will have a dependency on the Protobuf Objective-C runtime of the same
+    version. The runtime can be obtained as the "Protobuf" pod.
+  DESC
+  s.homepage = 'https://github.com/google/protobuf'
+  s.license  = {
+    :type => 'New BSD',
+    :text => <<-LICENSE
+      This license applies to all parts of Protocol Buffers except the following:
+
+      - Atomicops support for generic gcc, located in
+        src/google/protobuf/stubs/atomicops_internals_generic_gcc.h.
+        This file is copyrighted by Red Hat Inc.
+
+      - Atomicops support for AIX/POWER, located in
+        src/google/protobuf/stubs/atomicops_internals_power.h.
+        This file is copyrighted by Bloomberg Finance LP.
+
+      Copyright 2014, Google Inc.  All rights reserved.
+
+      Redistribution and use in source and binary forms, with or without
+      modification, are permitted provided that the following conditions are
+      met:
+
+          * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+          * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following disclaimer
+      in the documentation and/or other materials provided with the
+      distribution.
+          * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived from
+      this software without specific prior written permission.
+
+      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+      "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+      LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+      A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+      OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+      SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+      LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+      DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+      THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+      OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+      Code generated by the Protocol Buffer compiler is owned by the owner
+      of the input file used when generating it.  This code is not
+      standalone and requires a support library to be linked with it.  This
+      support library is itself covered by the above license.
+    LICENSE
+  }
+  # "The name and email addresses of the library maintainers, not the Podspec maintainer."
+  s.authors  = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
+
+  repo = 'google/protobuf'
+  release = "v#{v}"
+  file = "protoc-#{v}-osx-x86_64.zip"
+  s.source = {
+    :http => "https://github.com/#{repo}/releases/download/#{release}/#{file}",
+    # TODO(jcanizales): Add sha1 or sha256
+    # :sha1 => '??',
+  }
+
+  s.preserve_paths = 'protoc',
+                     'google/**/*.proto' # Well-known protobuf types
+
+  # Restrict the protobuf runtime version to the one supported by this version of protoc.
+  s.dependency 'Protobuf', v
+  # For the Protobuf dependency not to complain:
+  s.ios.deployment_target = '7.1'
+  s.osx.deployment_target = '10.9'
+
+  # This is only for local development of protoc: If the Podfile brings this pod from a local
+  # directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be
+  # present in this pod's directory. We use that knowledge to check for the existence of the file
+  # and, if absent, build it from the local sources.
+  repo_root = '../..'
+  plugin = 'grpc_objective_c_plugin'
+  s.prepare_command = <<-CMD
+    if [ ! -f protoc ]; then
+      cd #{repo_root}
+      # This will build protoc from the Protobuf submodule of gRPC, and put it in
+      # #{repo_root}/bins/opt/protobuf.
+      #
+      # TODO(jcanizales): Make won't build protoc from sources if one's locally installed, which
+      # _we do not want_. Find a way for this to always build from source.
+      make #{plugin}
+      cd -
+    fi
+  CMD
+
+end
diff --git a/src/objective-c/README.md b/src/objective-c/README.md
index 736c324..a0ca5f4 100644
--- a/src/objective-c/README.md
+++ b/src/objective-c/README.md
@@ -1,12 +1,12 @@
 [![Cocoapods](https://img.shields.io/cocoapods/v/gRPC.svg)](https://cocoapods.org/pods/gRPC)
 # gRPC for Objective-C
 
-- [Install protoc with the gRPC plugin](#install)
 - [Write your API declaration in proto format](#write-protos)
 - [Integrate a proto library in your project](#cocoapods)
 - [Use the generated library in your code](#use)
 - [Use gRPC without Protobuf](#no-proto)
-- [Alternative installation methods](#alternatives)
+- [Alternatives to the steps above](#alternatives)
+    - [Install protoc with the gRPC plugin](#install)
     - [Install protoc and the gRPC plugin without using Homebrew](#no-homebrew)
     - [Integrate the generated gRPC library without using Cocoapods](#no-cocoapods)
 
@@ -15,18 +15,6 @@
 plugin for the Protobuf Compiler (_protoc_) to generate client libraries to communicate with gRPC
 services.
 
-<a name="install"></a>
-## Install protoc with the gRPC plugin
-
-On Mac OS X, install [homebrew][].
-
-Run the following command to install _protoc_ and the gRPC _protoc_ plugin:
-```sh
-$ curl -fsSL https://goo.gl/getgrpc | bash -
-```
-This will download and run the [gRPC install script][]. After the command completes, you're ready to
-proceed.
-
 <a name="write-protos"></a>
 ## Write your API declaration in proto format
 
@@ -40,7 +28,8 @@
 
 You need to create a Podspec file for your proto library. You may simply copy the following example
 to the directory where your `.proto` files are located, updating the name, version and license as
-necessary:
+necessary. You also need to set the `pods_root` variable to the correct value, depending on where
+you place this podspec relative to your Podfile.
 
 ```ruby
 Pod::Spec.new do |s|
@@ -55,16 +44,44 @@
   s.ios.deployment_target = '7.1'
   s.osx.deployment_target = '10.9'
 
+  # Base directory where the .proto files are.
+  src = '.'
+
+  # We'll use protoc with the gRPC plugin.
+  s.dependency '!ProtoCompiler-gRPCPlugin', '~> 0.14'
+
+  # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
+  pods_root = '<path to your Podfile>/Pods'
+
+  # Path where Cocoapods downloads protoc and the gRPC plugin.
+  protoc_dir = "#{pods_root}/!ProtoCompiler"
+  protoc = "#{protoc_dir}/protoc"
+  plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
+
+  # Directory where you want the generated files to be placed. This is an example.
+  dir = "#{pods_root}/#{s.name}"
+
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
   # You can run this command manually if you later change your protos and need to regenerate.
-  s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto"
+  # Alternatively, you can advance the version of this podspec and run `pod update`.
+  s.prepare_command = <<-CMD
+    mkdir -p #{dir}
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=#{dir} \
+        --grpc_out=#{dir} \
+        -I #{src} \
+        -I #{protoc_dir} \
+        #{src}/*.proto
+  CMD
 
   # The --objc_out plugin generates a pair of .pbobjc.h/.pbobjc.m files for each .proto file.
-  s.subspec "Messages" do |ms|
-    ms.source_files = "*.pbobjc.{h,m}"
-    ms.header_mappings_dir = "."
+  s.subspec 'Messages' do |ms|
+    ms.source_files = "#{dir}/*.pbobjc.{h,m}"
+    ms.header_mappings_dir = dir
     ms.requires_arc = false
-    ms.dependency "Protobuf", "~> 3.0.0-beta-2"
+    # The generated files depend on the protobuf runtime.
+    ms.dependency 'Protobuf'
     # This is needed by all pods that depend on Protobuf:
     ms.pod_target_xcconfig = {
       'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
@@ -73,11 +90,12 @@
 
   # The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
   # a service defined.
-  s.subspec "Services" do |ss|
-    ss.source_files = "*.pbrpc.{h,m}"
-    ss.header_mappings_dir = "."
+  s.subspec 'Services' do |ss|
+    ss.source_files = "#{dir}/*.pbrpc.{h,m}"
+    ss.header_mappings_dir = dir
     ss.requires_arc = true
-    ss.dependency "gRPC-ProtoRPC", "~> 0.14"
+    # The generated files depend on the gRPC runtime, and on the files generated by `--objc_out`.
+    ss.dependency 'gRPC-ProtoRPC'
     ss.dependency "#{s.name}/Messages"
   end
 end
@@ -89,11 +107,14 @@
 the sample Podspec above. For example, you could use:
 
 ```ruby
-  s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
+  s.prepare_command = <<-CMD
+    ...
+        #{src}/*.proto #{src}/**/*.proto
+  CMD
   ...
-    ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
+    ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
   ...
-    ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
+    ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
 ```
 
 Once your library has a Podspec, Cocoapods can install it into any XCode project. For that, go into
@@ -121,19 +142,33 @@
 <a name="use"></a>
 ## Use the generated library in your code
 
-Please check this [sample app][] for examples of how to use a generated gRPC library.
+Please check the [example apps][] for examples of how to use a generated gRPC library.
 
 <a name="no-proto"></a>
 ## Use gRPC without Protobuf
 
-The [sample app][] has an example of how to use the generic gRPC Objective-C client without
-generated files.
+This [tests file](https://github.com/grpc/grpc/tree/master/src/objective-c/tests/GRPCClientTests.m)
+shows how to use the generic gRPC Objective-C client without generated protobuf files.
 
 <a name="alternatives"></a>
-## Alternative installation methods
+## Alternatives to the steps above
+
+<a name="install"></a>
+### Install _protoc_ with the gRPC plugin
+
+Although it's not recommended (because it can lead to hard-to-solve version conflicts), it is
+sometimes more convenient to install _protoc_ and the gRPC plugin in your development machine,
+instead of letting Cocoapods download the appropriate versions for you. To do so, on Mac OS X or
+later, install [homebrew][].
+
+The run the following command to install _protoc_ and the gRPC _protoc_ plugin:
+```sh
+$ curl -fsSL https://goo.gl/getgrpc | bash -
+```
+This will download and run the [gRPC install script][].
 
 <a name="no-homebrew"></a>
-### Install protoc and the gRPC plugin without using Homebrew
+### Install _protoc_ and the gRPC plugin without using Homebrew
 
 First install v3 of the Protocol Buffers compiler (_protoc_), by cloning
 [its Git repository](https://github.com/google/protobuf) and following these
@@ -145,15 +180,15 @@
 
 Compile the gRPC plugins for _protoc_:
 ```sh
-make plugins
+make grpc_objective_c_plugin
 ```
 
 Create a symbolic link to the compiled plugin binary somewhere in your `$PATH`:
 ```sh
 ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc
 ```
-(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it
-as a plugin).
+(Notice that the name of the created link must begin with "`protoc-gen-`" for _protoc_ to recognize
+it as a plugin).
 
 If you don't want to create the symbolic link, you can alternatively copy the binary (with the
 appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking
@@ -178,5 +213,5 @@
 [Protocol Buffers]:https://developers.google.com/protocol-buffers/
 [homebrew]:http://brew.sh
 [gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
-[example Podfile]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/Podfile
-[sample app]: https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample
+[example Podfile]:https://github.com/grpc/grpc/blob/master/examples/objective-c/helloworld/Podfile
+[example apps]: https://github.com/grpc/grpc/tree/master/examples/objective-c
diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
index e3b50dd..6e783fb 100644
--- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
@@ -11,15 +11,30 @@
   s.osx.deployment_target = '10.9'
 
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+  s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+  repo_root = '../../../..'
+  bin_dir = "#{repo_root}/bins/$CONFIG"
+
+  protoc = "#{bin_dir}/protobuf/protoc"
+  well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
+  plugin = "#{bin_dir}/grpc_objective_c_plugin"
+
   s.prepare_command = <<-CMD
-    protoc --objc_out=. --objcgrpc_out=. *.proto
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=. \
+        --grpc_out=. \
+        -I . \
+        -I #{well_known_types_dir} \
+        *.proto
   CMD
 
   s.subspec 'Messages' do |ms|
     ms.source_files = '*.pbobjc.{h,m}'
     ms.header_mappings_dir = '.'
     ms.requires_arc = false
-    ms.dependency 'Protobuf', '~> 3.0.0-beta-3.1'
+    ms.dependency 'Protobuf'
     # This is needed by all pods that depend on Protobuf:
     ms.pod_target_xcconfig = {
       'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
@@ -30,7 +45,7 @@
     ss.source_files = '*.pbrpc.{h,m}'
     ss.header_mappings_dir = '.'
     ss.requires_arc = true
-    ss.dependency 'gRPC-ProtoRPC', '~> 0.14'
+    ss.dependency 'gRPC-ProtoRPC'
     ss.dependency "#{s.name}/Messages"
   end
 end
diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile
index 80ab2c3..8740b2f 100644
--- a/src/objective-c/examples/Sample/Podfile
+++ b/src/objective-c/examples/Sample/Podfile
@@ -12,6 +12,9 @@
 
   # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
   # lines in your application.
+  pod '!ProtoCompiler',  :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+  pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
   pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
 
   pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/examples/SwiftSample/Podfile b/src/objective-c/examples/SwiftSample/Podfile
index b675fd2..2f78334 100644
--- a/src/objective-c/examples/SwiftSample/Podfile
+++ b/src/objective-c/examples/SwiftSample/Podfile
@@ -12,6 +12,9 @@
 
   # Use the local versions of Protobuf, BoringSSL, and gRPC. You don't need any of the following
   # lines in your application.
+  pod '!ProtoCompiler',  :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+  pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
   pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf"
 
   pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile
index 30a3426..17b9740 100644
--- a/src/objective-c/tests/Podfile
+++ b/src/objective-c/tests/Podfile
@@ -17,12 +17,18 @@
 ).each do |target_name|
   target target_name do
     pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true
-    pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
+
+    pod '!ProtoCompiler',            :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+    pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c"
+
+    pod 'BoringSSL',       :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
     pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
-    pod 'gRPC', :path => GRPC_LOCAL_SRC
-    pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
+
+    pod 'gRPC',           :path => GRPC_LOCAL_SRC
+    pod 'gRPC-Core',      :path => GRPC_LOCAL_SRC
     pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC
     pod 'gRPC-ProtoRPC',  :path => GRPC_LOCAL_SRC
+
     pod 'RemoteTest', :path => "RemoteTestClient"
   end
 end
@@ -65,7 +71,7 @@
     end
     if target.name == 'gRPC-Core'
       target.build_configurations.each do |config|
-        # TODO(zyc) Remove this setting after the issue is resolved
+        # TODO(zyc): Remove this setting after the issue is resolved
         # GPR_UNREACHABLE_CODE causes "Control may reach end of non-void
         # function" warning
         config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
diff --git a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
index 25c9c7f..7d84a5a 100644
--- a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
@@ -11,20 +11,30 @@
   s.osx.deployment_target = '10.9'
 
   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+  s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
+
+  repo_root = '../../../..'
+  bin_dir = "#{repo_root}/bins/$CONFIG"
+
+  protoc = "#{bin_dir}/protobuf/protoc"
+  well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
+  plugin = "#{bin_dir}/grpc_objective_c_plugin"
+
   s.prepare_command = <<-CMD
-    BINDIR=../../../../bins/$CONFIG
-    PROTOC=$BINDIR/protobuf/protoc
-    PLUGIN=$BINDIR/grpc_objective_c_plugin
-    # we use this path to locate well-known proto files
-    PROTO_SRC=../../../../third_party/protobuf/src
-    $PROTOC --plugin=protoc-gen-grpc=$PLUGIN --objc_out=. --grpc_out=. *.proto -I $PROTO_SRC -I .
+    #{protoc} \
+        --plugin=protoc-gen-grpc=#{plugin} \
+        --objc_out=. \
+        --grpc_out=. \
+        -I . \
+        -I #{well_known_types_dir} \
+        *.proto
   CMD
 
   s.subspec "Messages" do |ms|
     ms.source_files = "*.pbobjc.{h,m}"
     ms.header_mappings_dir = "."
     ms.requires_arc = false
-    ms.dependency "Protobuf", "~> 3.0.0-beta-3.1"
+    ms.dependency "Protobuf"
     # This is needed by all pods that depend on Protobuf:
     ms.pod_target_xcconfig = {
       'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
@@ -35,7 +45,7 @@
     ss.source_files = "*.pbrpc.{h,m}"
     ss.header_mappings_dir = "."
     ss.requires_arc = true
-    ss.dependency "gRPC-ProtoRPC", "~> 0.14"
+    ss.dependency "gRPC-ProtoRPC"
     ss.dependency "#{s.name}/Messages"
   end
 end
diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c
index cca75f5..ab80adf 100644
--- a/test/core/end2end/bad_server_response_test.c
+++ b/test/core/end2end/bad_server_response_test.c
@@ -71,6 +71,8 @@
 
 #define UNPARSEABLE_DETAIL_MSG "Failed parsing HTTP/2"
 
+#define HTTP1_DETAIL_MSG "Trying to connect an http1.x server"
+
 /* TODO(zyc) Check the content of incomming data instead of using this length */
 #define EXPECTED_INCOMING_DATA_LENGTH (size_t)310
 
@@ -334,7 +336,7 @@
 
   /* http1 response */
   run_test(HTTP1_RESP, sizeof(HTTP1_RESP) - 1, GRPC_STATUS_UNAVAILABLE,
-           UNPARSEABLE_DETAIL_MSG);
+           HTTP1_DETAIL_MSG);
 
   return 0;
 }
diff --git a/tools/distrib/python/grpcio_tools/README.rst b/tools/distrib/python/grpcio_tools/README.rst
index 8946a1d..4e5263d 100644
--- a/tools/distrib/python/grpcio_tools/README.rst
+++ b/tools/distrib/python/grpcio_tools/README.rst
@@ -122,6 +122,7 @@
     third_party/protobuf/src/google/protobuf/stubs/mathlimits.h:173:31: note: in expansion of macro 'SIGNED_INT_MAX'
     static const Type kPosMax = SIGNED_INT_MAX(Type); \\
                                ^
+
   And your toolchain is GCC (at the time of this writing, up through at least
   GCC 6.0), this is probably a bug where GCC chokes on constant expressions
   when the :code:`-fwrapv` flag is specified. You should consider setting your
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index f081887..95d53e5 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -662,7 +662,7 @@
     return []
 
   def make_targets(self):
-    return ['grpc_objective_c_plugin', 'interop_server']
+    return ['interop_server']
 
   def make_options(self):
     return []