Renaming default Cocoapods project - cocoapods

Is it possible to rename the default Pods xcodeproj and Pods subdirectory that are generated when you run pod install? Is there any way in the Podfile or pass an argument to pod install to do this? I couldn't find anything that suggested this on the http://cocoapods.org documentation.

This is not currently an option of any kind in CocoaPods. If you would like to see this in a future version we gladly accept pull requests over on Github

Related

Can't add "MidiParser" pod to Podfile

I am trying to add this github project to my project as a pod: https://github.com/matsune/MidiParser
In my PodFile, I have tried
pod 'MidiParser'
and
pod 'MidiParser', :git => 'https://github.com/matsune/MidiParser.git'
but either time I get the error
Unable to find a specification for 'MidiParser'.
I have tried adding other pods like 'https://github.com/daltoniam/SwiftHTTP' just to see if they work, and they do. I notice there are multiple projects on GitHub called MidiParser, so maybe I need to distinguish between them somehow? The installation instructions in the MidiParser README only give instructions for Carthage. It says to add this line to the Cartfile:
github "matsune/MidiParser"
I also have also tried:
pod 'matsune/MidiParser'
I notice I can't find the project when I search for it here: https://cocoapods.org.
Does that mean I simply can't install the project using Cocoapods, and that I have to do it manually?
Edit: I ended up using Carthage.
CocoaPods requires pods to be specified with a podspec to describe its Xcode workspace integration. See https://guides.cocoapods.org/making/making-a-cocoapod.html

Cocoapods: how to delete one pod manually?

How to delete one pod manually with Cocoapods in Xcode?
I knew pod deintegrate, I have seen How to remove CocoaPods from a project?
It is too hard for me. Need more details, or a tutorial.
The reason of doing it:
I take part in an old, massive project.There are thousands of warnings there . So I want to maintain a personal version of the project.
When starting to delete one pod ,failed after running pod install
the warnings:
term pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (1.5.0) is higher than the version of the current executable (1.4.0). Incompatibility issues may arise.
Cloning spec repo `z-appplatform-zspecs` from `http://git.zsys.com/AppPlatform/zSpecs.git`
[!] Unable to add a source with url `http://git.zsys.com/AppPlatform/zSpecs.git` named `z-appplatform-zspecs`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
The remote repos are of my company's server, I need authorization (secret).
After a lot of communication with my leader, he said "The pods don't need to update. And he can't give me the authorization to remote repo, he will manually do it for me"
Not convenient, with trying a lot to improve a massive project.

List installed cocoapods and versions

Does the pod command support an option to list the installed CococaPods in a given project? pod list appears to display a list of all published pods. I've looked around in the documentation but can't find a way of doing this.
As stated in #DougAmos' answer you should check your Podfile.lock to see this information using cat Podfile.lock
This doesn't currently exist in CocoaPods. Personally I would just do a cat Podfile to learn about what the project was including. I would suggest you create an issue (or even better a pull request) on the main repository about this!
From the root directory of your project:
cat Podfile.lock
(I know this has been mentioned in a comment, but this should be an answer in it's own right)
I developed a little script
llpod
available here.
Nevertheless, up until now I listed pods with cat:
cat Podfile.lock
And refine search with grep:
cat Podfile.lock | grep Alamo
pod outdated lists installed pods with version numbers and the latest versions available.
An old question but I still had to find out which version of a pod was installed.
I used the following, it listed everything but in the output is a section like:
Downloading dependencies
-> Using AFNetworking (2.7.0)
Where I had
pod "AFNetworking", "~> 2.0"
In the PodFile

Incorrect path for Pods.debug.xcconfig in Xcode?

so I used Venmo/Synx on my Xcode project with CocoaPods, and it completely screwed everything up.
I was able to fix the Manifest.lock and Podfile.lock errors, but now I am getting this error:
The file “Pods.debug.xcconfig” couldn’t be opened because there is no such file. (/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig)
As you can see, the path is incorrect, as there is no Pods/Pods directory (there is one extra pod).
How can I fix this? I have only added PODS_ROOT to the user-defined variable, as that fixed my Podfile and Manifest.lock files.
Any help would be much appreciated!
Edit:
After adding PODS_ROOT, I get this when running pod install.
[!] The `Project [Debug]` target overrides the `PODS_ROOT` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
I had the same problem in Xcode 6.1.1. I did the following to solve it:
Set the configuration file setting* "None" for the Pods related target.
Close the .xcworkspace.
run pod install again
now open and build your .xcworkspace
*The configuration file setting is found by selecting the project (not the target) and then the Info tab.
If your path to pods in error is wrong try this:
use pod deintegrate
delete all pod remains files - Podfile.lock, Pods, <Project>.xcworkspace
open <Project>.xcodeproj
remove Pods project on left side
try pod install
I had the same problem with Xcode 11 but I just updated CocoaPods and it worked.
Update CocoaPods to latest version with sudo gem install cocoapods
Run pod install again
I had the same error while trying to build my project for the first time. This is how I resolved it:
pod deintegrate
sudo gem install cocoapods-clean
pod clean
Open the project and delete the “Pods” folder that should be red.
pod setup
pod install
Reopen and build the project, I think it's good to go!
I faced this issue when I upgraded/downgraded cocoapods between 1.6.x and 1.5.x.
The following step fixed this error
1, go to project info tab
2, just under Deployment target, there is configurations field. change your configuration. In my case, there are 2 options
/Users/user/GitHub/xxxxxx/Pods/Pods/Target Support Files/Pods/Pods.debug.xcconfig
/Users/user/GitHub/xxxxxx/Pods/Target Support Files/Pods/Pods.debug.xcconfig
3, clean and build again.
1- Remove your Pods folder Podfile.lock and xcworkspace files root in your project.
2- Open .xcodeproj
3- Go to Build Settings and under Build Options search Always Embed Swift Standard Libraries
4- Update its value with $(inherited)
5- Close project and pod install again
There has been an update to cocoa pods that is causing this problem. Please refer to the cocoa pods release notes :
Change shell script relative paths to use ${PODS_ROOT} instead of ${SRCROOT}/Pods.
Whirlwind #7878
This was done in version 1.6.0.beta.1 (2018-08-16)
Release notes are here: cocoapods release notes
I had the same error and I fixed in following way
1 - Goto your projected setting by blue icon of your project from left pan
2 - Select your project under the project
3 - Select Info window
4 - Check IOS deployement target. This target should be same as you set in general settings of your project (Pic 2).
I got the same situation in Xcode 10.1. This is what works for me.
Open <Project>.xcworkspace
Go into your <project_name> folder(by default it's blue), delete the Pods folder (by default it's yellow)
In Terminal.app, run pod install again
Then I'm able to CMD + R to run the simulator
A few things worth trying:
As Keith mentioned above, you definitely want to exclude Pods from synx.
You almost certainly do not want to override the PODS_ROOT build setting.
I've seen similar errors to yours in a project with multiple targets. Make sure that your Podfile includes a link_with setting that specifies all your app targets.
If you have at least one test target, consider using your Podfile to explicitly import all your app pods to both your application and test targets.
I've not too much experience using a custom xcconfig with CocoaPods, but you might first try removing your xcconfig and allowing CocoaPods to generate its own first.
Close project
Do pod deintegrate
Delete - Podfile.lock, Pods,.xcworkspace in project directory
Do sudo gem install cocoapods
Do pod install
Go to project directory right click on
project.xcodeproj -> show package contents -> open project.pbxproj
Find
"Pods/Target Support Files/
and replace with
"Target Support Files/
This solution will work at any cost!
Try deleting the debug.xcconfig file and run pod install again. It solved my issue
In my case, I deleted my Podfile, Podfile.lock.
Run pod init, then copy all pods to new Podfile, then run pod install again and it's worked.
I think it's happened for the differences from folder paths in the old project (for me, I cloned another project from Git repo).
For me, changing Build system to Legacy in File -> workspace settings did the trick
For me, this caused after I updated cocoapods. So, I downgraded and the build worked again.
To downgrade, first list of all your versions:
sudo gem list cocoapods
Then specify the you want to delete (for me was 1.8.4):
sudo gem uninstall cocoapods -v 1.8.4
Then, with 1.5.3 worked!
This is what worked for me !
I use always Bundler to manage ruby dependencies, then in all my iOS projects i have Gemfile that look like this !
source "https://rubygems.org"
gem "cocoapods"
gem "fastlane"
gem "jazzy"
gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git'
gem 'fastlane-plugin-teams', :git => "https://github.com/mbogh/fastlane-plugin-teams"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
i just run the following, i advice you using alias for this :
## Alias to add in zshrc or bashrc
# bundle install
bdli() {
bundle install $#;
}
piu() {
kill $(ps aux | grep 'Xcode' | awk '{print $2}');
pod deintegrate;
pod repo update;
pod install;
pod update;
open -a Xcode *.xcworkspace;
}
then simply run :
bdli && piu
It will do everything for you :)
PS : To install Bundler go here -> Bundler
pod reintegrate
pod install
edit the .xcodeproj/project.pbxproj file and change the PBXGroup "path = Pods" to "name = Pods"

Install Pods via .podspec?

I found some iOS libraries in Github that has a .podspec file, but it does not appear in Cocoapods' repository. Is there any chance I can use pod commands to install this library?
Example library: DDSlidingPanels
Yes. You can copy their podspec into another folder such as ~/.cocoapods/repos/whatever/name/version/name.podspec and then CocoaPods will be able to find it.

Resources