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!
hi @mtitolo has there been any update regarding this issue so far? I'm getting the same issue in XCode 6 (when I attempt to integrate XCode CI in my OSX project. My project is in a workspace and is using cocopods). The only workaround that I've found so far is by committing all the pods files and all the workspace files to the repository in order to get it to build. The pre-action (set up in a scheme) or the before-trigger in the bot doesnt work with "pod install". Thanks