(p.1) Cozy pod install
In this post, I will describe how you can enhance your work with CocoaPods in the terminal. I often have to use CocoaPods in my work, and even more often I open a terminal and write there pod install.
••• pod install
CocoaPods
You can read more about CocoaPods here. In short, this is the dependency (pods) manager. It allows you to describe the necessary dependencies in a convenient form. Then use a set of simple commands to load them and integrate into your Xcode project.
The most used command is pod install. You can read more about it here.
Let's get to know it a little closer and try to understand what can upset us.
The usual usage scenario looks like this:
- We pull up the latest changes from the repository;
- Open the terminal, go to the project folder;
- Call pod install, wait until everything is installed;
- Launch the project.
Bundler
The first upset with regularly using pod install is Bundler. Another dependency manager, but this time for Ruby.
When calling pod install, it's creating a file with a description of all installed dependencies — Podfile.lock. This file also contains your version of CocoaPods. Since it can be different depending on the developer's environment, it is also worth syncing. This will reduce the number of conflicts in git.
But what exactly is the problem? Just use it and that's all! — you will say. But this is twice more words.
••• bundle exec pod install
Bash alias
Perhaps someone has already guessed that this problem is easily solved using aliases in Bash. The idea is very simple. We will come up with a short word that will be replaced with this long four-letter command.
OK, we are set up. It is best to fix this for good. To do this, let's write this alias to .bash_profile.
- Add the alias pods in .bash_profile;
- Apply changes from .bash_profile;
- Use it!
••• echo alias pods=\"bundle exec pod\" >> ~/.bash_profile••• source ~/.bash_profile••• pods install
That's all for now. In the next part of this post, I will describe what other upsets are encountered using pods install. And we will make it a little bit better.
💬 Please, leave some feedback in Twitter post.
It will help me improve posts and continue to publish new ones.
Translated one more post "(p.1) Cozy pod install"#ios #tools #cocoapods #bashhttps://t.co/1A7TzwFIax pic.twitter.com/sy8fSk9pxu
— Ну Слаааава (@swiftyfinch) June 13, 2020