This post is an extended answer to The Trick to Working with CocoaPods on a Team post. Jump to it, read, and go back here.
Update 19/Dec/2015 6:41 PM: Okay, Natasha helped me realize that my solution is a bit overkill. I used the Gemfile in the project and I like it :) Instead of writing script to check if CocoaPods exists and install them if not, I just created a script with two commands she mentioned. So it look like this:
And the Gemfile is just this
So, yeah, this is what Natasha mentioned in her post :) Thanks Natasha!
I think the better way to ensure that teammates use the same CocoaPods is not
to modify the Podfile, but to write simple bash script.
(I made a mistake. Natasha is using Gemfile, so Podfile is not modified).
Also, instead Instead of manually call
bundle install and
bundle exec pod install (She uses Gemfile for that) I would like to let the script do a proper work for me - The Gemfile might be better if we have more gems to control.
Here is my suggestion for this.
- The script do check whether required CocoaPods version is installed.
- If CocoaPods in specified version does not exist, install it.
- If CocoaPods is installed, install pods using this version.
Now you can save the script, call it setup.sh, and in terminal just execute
Never used such way to ensure CocoaPods integrity, and it was only me who integrated and updated pods of a project. So I believe, I’ll be using it with my team since now.