Never Type Pod Install Again… Ever!

Abhishek Bedi
The Startup
Published in
2 min readSep 19, 2020

I was once working on a bugfix & taking help from my friend. He, out of nowhere, did a cool magic trick that grabbed my attention.

With a cool keyboard shortcut, all the pods were installed 😲😲😲

On further inquiring, I find out something that was so obvious yet we missed it many times. So here’s the trick.

Problem:

Whenever we switch branches, we need to do a pod install, every single time.

Solution:

Let's create a script, pump it into Xcode & hook it up with a keyboard shortcut.

Step 1: Creating the Script

You don't need to worry about anything. Download the script from here.

Alternatively, you can create the script yourself.

The script basically asks the Terminal App to open the project directory & do a pod install.

#!/bin/sh
osascript <<END
tell application "Terminal"
if not (exists window 1) then reopen
activate
do script "cd `pwd`;pod install" in window 1
end tell
END

Step 2: Pump the script into Xcode.

Xcode → Behaviors →Tap On + Button → Name the custom workflow as pod-install → Run Script → Select the script

Xcode → Behaviors →Tap On + Button -> Name the custom workflow as pod-install → Run Script → Select the script

Step 3: Hook up a Keyboard Shortcut

Next to your script name, just double click and assign any keyboard shortcut. My personal favourite is ⌘P, since I don't print my code 😛

That's it! You are done! Happy Coding!

--

--

Abhishek Bedi
The Startup

The Power Of Imagination 🤔 … You Can’t Even Imagine 😇