Using CocoaPods on Windows

Step one — install Ruby

Ruby is required to run CocoaPods. An easy way to install Ruby is to download an installer from https://rubyinstaller.org/. Use the recommended download (Ruby+DevKit x64) unless you have a reason to install a different package.

Step two — install curl

CocoaPods uses curl to download packages. Since curl is not installed by default on Windows machines, you will need to install it — you can get curl from https://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=-&ver=*&cpu=x86_64. Download the latest 64-bit curl, extract the package and make sure that curl.exe in accessible via command line.

Step three — install git

CocoaPods needs git and tar command-line tools. You can install git from https://git-scm.com/download/win. When installing git, you may select the “Use Git and optional Unix tools from the Command Prompt”. Use default settings for everything else.

Step four — install CocoaPods

Now that all the tools have been installed, install CocoaPods.

Step five — running pod commands (optional)

In order to run “pod install”, you need an actual Xcode project. Since Xcode does not run on Windows, use a macOS machine with Xcode to generate an Xcode project. To test CocoaPods:

  • Transfer the Xcode project to the Windows machine
  • Navigate to the project folder using the command line
  • Run “pod init” to create the Podfile
  • Edit the Podfile and add some pods (for example, you can add “Firebase/Analytics”)
  • Run “pod install” to install the pods

--

--

Write code for fun and living

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store