Pod init error tool 'xcodebuild' requires Xcode

It needs to set your CocoaPod and command line tool version, in your Xcode:

Reset (Uninstall & install) cocoa pod:
Execute the following on your terminal to get the latest stable version:

sudo gem install cocoapods

Use keyword --pre to get the latest pre-release:

sudo gem install cocoapods --pre

How to set/reset Command Line Tool:
You can download latest command line tool from Apple Download Portal, if you have paid apple developer account/id.


Here are current beta and stable Xcode Tool and supporting command line tool download link. (Ensure you'are logged in using premium developer account on Apple Developer Account to access these links)

Xcode 10

  • Xcode 10
    - (Command Line Tool (Xcode 10) - for macOS 10.14)
    - (Command Line Tool (Xcode 10) - for macOS 10.13)

Once you've latest command line tool installed in your system, set it from Xcode Menu.

(Xcode Menu Items) Xcode ▶ Preferences ▶ Location ▶ Command Line Tool ▶ Select appropriate command line tool

enter image description here


Try the same with Terminal App

Install Command Line Tools (using Terminal app):

xcode-select --install

Change the active directory:

sudo xcode-select -switch /Library/Developer/CommandLineTools