Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

CocoaPodsなプロジェクトで複数ブランチを行き来する際に"sandbox is not in sync"でイライラしない方法

コードレビュー等のためにブランチ間を行き来していると、XCodeビルドを走らせてからこのようなエラーが出てpod installが必要と気づく事が多い。

error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

できればブランチを切り替えた際必要に応じて自動でpod installしたい。


diff Podfile.lock Pods/Manifest.lock > /dev/null
if [[ $? != 0 ]]; then
  echo "Sandbox needs to be updated. Re-installing libraries..."
  bundle exec pod install

これでチェックアウト先でpodsの再インストールが必要であればpod installが開始される。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
Help us understand the problem. What are the problem?