How to delete pods from subversion branch in Xcode 5 - xcode

I am using CocoaPods to manage third party libraries and now I need to remove one of the pods.
Normally I would go to the local folder where I have checked out the repository folder to delete the files and then run pod install.
However, when trying to find the local folder for the subversion branch, I can not seem to find it. I checked in Xcode 5+ and it says the local folder for my branch is the same as the one I branched from. This seems strange to me because of how subversion normally works.
It would seem counterintuitive to be forced to check out every branch manually to be able to interact with the files from the command line.
How do I go about resolving this and deleting a pod from my branch without messing up the source of the branch?

Not sure exactly how you're saying that subversion makes this more difficult but to remove a pod from a project you should remove the line from your Podfile and run pod install

Related

Project Not Opening in XCode

My partner and I are using git to share our Xcode project. We accidentally added the same cocoapod and when I pulled from GitHub my project now won't open.
The merge error is in the podfile.lock but I can't figure out how to access that to fix it.
I've tried everything I can find on the internet which led me to the podfile.lock but I can't figure out where to go from here.
Generally, the error message is about
error: The sandbox is not in sync with the Podfile.lock
Run 'pod install' or update your CocoaPods installation
The usual workaround is to delete to Pod from the project, but here, the goal is to keep it, so, as the OP Ethan Hardacre comments:
the only solution to this problem that I could find was deleting the project and redownloading from GitHub.
In other words, keep the one that was pushed first to GitHub.

Multiple targets for project in xcode

I am using xcode 7.3.1. After pod update, it's showing multiple project target in the project having same details without any change. How can I fix this? If I delete any one of these, xcode crashes and when we reopen even the other option comes in red and we dont have any project.
Have you tried to delete the workspace file and the pod directory, and re-launch a pod install ? The workspace file does not hold any important information to be retained in CocoaPods.
If you have the same problem after regenerating, it means there is an error in the Pod file.

How to change a github repo's directory to somewhere else?

To avoid being a X-Y problem, this is what happened:
I removed all the pods from the Podfile a few days ago because I didn't need them anymore. Today, I opened up the xcworkspace and see errors. One of them is this:
diff: /../Podfile.lock: No such file or directory
So I first try to solve the issue myself. I tried pod install, pod update, and lots of other stuff. They all didn't work. So I thought, FINE! I'll delete all the cocoapod-related stuff and start from scratch again! And so I did. But the problem is still there.
Then I downloaded the whole project from github and deleted the broken one. I tried updating cocoapods to the newest version and pod install, everything is working in the downloaded project.
After that, I found out that github is not tracking the changes of the downloaded project. It is still tracking the changes of the project in the trash.
I need to find a way to change the project that github is currently tracking to the downloaded project. How do I do this?
P.S. I am an absolute noob of command line interfaces. I cannot remember all those git commands. So if someone can show the solution both using the github (Mac) app and the CLI, it would be greatly appreciated.
I solved this problem with this:
Create a temp folder
Move all the stuff in the downloaded project's project folder to the temp folder
Delete the downloaded project's project folder, which is now empty
Move the deleted project from trash to the original position i.e. "Put Back"
Delete the contents of the original project folder
Move the stuff in the temp folder into the original project folder, which is now empty
Profit!
You might have to add the newly downloaded copy to the SourceTree.
here are the steps -
SourceTree --> New Repository --> Add existing Local Repo --> Then in the finder window locate the newly downloaded repo.
Now I believe you can see the changes of the new project and commit as well. PFA screenshot.

Sharing CocoaPods-enabled Xcode project with team via SVN

I have started using CocoaPods in an Xcode project that I am sharing with a non-technical team via SVN.
Before I commit the contents of my project folder, I wanted to ask whether they would also need CocoaPods installed in order to build and run the project?
Hopefully not?
If you do not add the Pods folder to your SVN repo then they will obviously have to have CocoaPods to build the project. Since otherwise none of your third party libraries will be included.
If you do add the Pods folder then the project will work just fine without CocoaPods installed.

Source Control - Discard all changes deleted my xcworkspace and I can't fix it

I was trying to undo changes on my project to the last committed Source Control state, however when I pressed 'Discard all changes' weird behaviour happened.
The first time some of the files reverted whilst others didn't. So I pressed the button again and a blurb popped up saying something about needed to re-save the 'xcworkspace'. I pressed okay and half my files disappeared from the xcode file list on the left, really random files that hadn't been edited at all. So I decided to press revert again to see if I could get back to my original state, and now all my files have disappeared from the xcworkspace. So my screen now looks like this:
I have tried restoring the files from my trash (as this is where random ones have appeared) but the workspace is never restored. I use MapBox so I have 2 projects building in to 1 workspace, but the podfile will now not install.
Can anyone give me advice on how to get this back to it's original state as I have been trying for a few hours but can't find any information.
I felt horrible when I did this. I really thought I had to rebuild everything over again. Luckily, it was easy to repair.
Xcode removed all the "non-essential" files. This includes your Podfile (and if applicable, GoogleService-Info.plist).
To Repair:
Go to Terminal and create a Podfile in your project folder $ pod init
Update your Podfile with the pods you need
Run $ pod install
(4.) To re-generate the GoogleService-Info.plist file, go to your console.firebase.google.com > Settings > Project Settings > Download the latest config file for the appropriate project iOS app and save to your local project folder. Your workspace should recognize the file in the Project Navigator list.
Once you open your workspace, select new Scheme and everything should be back to normal.
To avoid future regressions:
Go to Terminal
git add -A
to add the pod files, then
git commit -m "Save pod files"
to save pod files. I believe git from Xcode ignores the pod and scheme files.

Resources