Create your own shortcuts in Xcode to eliminate the hassle of pod install


I sometimes see multiple projects at the same time in my work, and on average I open the terminal about once a day and hit the pod-install command. This article is a tip that makes it easier for iOS app developers to work with the CocoaPods command pod-install. Xcode has a function called Behaviors, which allows you to set and add various actions and events. Using that function, create a shortcut key that automatically opens the terminal, moves to the specified directory, and hits the pod-install command.

Development environment

Xcode12 (I think it works with Xcode11, but it has not been verified) Cocoapods


1. Prepare Script

Download Script

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

2. Grant execution authority

Confirmation of authority

$ ls -l 
-rw-rw-r--@ 1 yasuradodo  staff  158 Sep 19 19:40

If you do not have execute permission, grant execute permission x

$ chmod u+x  

Check permissions again

$ ls -l 
-rwxrw-r--@ 1 yasuradodo  staff  158 Sep 19 19:40

3. Create Custom command in Behaviors of Xcode


Register your favorite key for the shortcut. I chose shift + command + p. Now, you can automatically execute pod-install at any time with the shortcut registered on Xcode. At the end, this time it was only pod-install, but it can support various things such as Carthage, SourceTree, SwiftLint, etc. and improve work efficiency. If you have any other useful ways to use Behaviors, please let me know: pray: References

Recommended Posts

Create your own shortcuts in Xcode to eliminate the hassle of pod install
How to create your own annotation in Java and get the value
Utilization of Talend component (5) Create your own component
Create your own dialect to convert line feed code to line feed tag in Thymeleaf3
Contemplation: How to take advantage of functional interfaces in your own functions (java)
How to install Docker in the local environment of an existing Rails application [Rails 6 / MySQL 8]
I tried to create a log reproduction script at the time of apt install
Install multiple submit buttons in Rails View to get the value of the pressed button
Understand the characteristics of Scala in 5 minutes (Introduction to Scala)
How to install the root certificate of Centos7 (Cybertrust)
Mandels to create an image of the Mandelbrot set
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
How to read your own YAML file (*****. Yml) in Java
Install by specifying the version of Django in the Docker environment
[Forge] How to register your own Entity and Entity Render in 1.13.2
How to create a placeholder part to use in the IN clause
Create a method to return the tax rate in Java
Set the time zone in the JVM of your Azure application
How to derive the last day of the month in Java
[Rails] Where to be careful in the description of validation
Create more Tabs and Fragments in the Fragment of BottomNavigationView
Use your own classes in the lib directory with Rails6
802.1X authentication to the network of Bonding setting in CentOS7
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible