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!
Thanks @mtitolo - I have followed your instructions but am still getting the following error:
Which I read as meaning that
pod install
did not actually run. The bot logs don't include anything pod-related so I'm not sure exactly how to debug further. Did you run into this case by chance? Thank you!