To run pod install
as a pre-build action for your target using RVM, follow these easy steps.
- Duplicate your main scheme, and make sure it's shared
- Navigate to the Edit Build section of your new scheme
- Uncheck
Find Implicit Dependencies
(otherwise Xcode will stop the build when the workspace contents change) - Go into the Pre-actions subsection
- Add a new run script with the following content:
source "$HOME/.rvm/scripts/rvm"
rvm use ruby-1.9.3-p194 # whichever version of Ruby you installed the cocoapods gem to
cd ${SRCROOT}
pod install
- Change the
Shell
to/usr/bin/env bash
and make sure to Provide Build Settings from your target - Click OK
- Switch to the new scheme, and build!
After
pod install
is run the first time, that file is unlikely to change. A.xcworksapce
file is just XML that references one or more.xcodeproj
files. Not sure about the other team members, but of all the CocoaPods files I only check in the.xcworkspace
,Podfile
, andPodfile.lock
.If you have your
.xcworkspace
open, when creating a Bot it should automatically setup to build that file. If you created your bot and it's not looking at the right.xcoworkspace
, you can change which.xcodeproj
or.xcworkspace
is used to build in Bot Settings (so you don't have to go through and recreate it, which IMHO is a PITA).