How to deal with loss of "Create Snapshot" in Xcode 7.0? - ios

To my great disappointment, I've found that Xcode 7 no longer has the "Create Snapshot" command for creating a good backup copy of a project for recovery purposes. In fact, it doesn't have a "Restore Snapshot" command, either, so all of the many, many project Snapshot files that I've taken can apparently no longer be read and used(!).
I understand that Git and Xcode Snapshots are "totally separate" things (git vs xcode snapshot), so apparently I can't use Git to develop a Git-based equivalent to the old Xcode 'Snapshot' capability or to read old 'Snapshot' files?
Is there any solution to bring back a 'Snapshot'-like capability and read my old 'Snapshot' files, or do I just have to give up and rely on the Git commands under Xcode's ">Source Control" menu?

As a workaround, you still can, indeed, fallback to the command-line, and do a git archive.
That will create a compressed image of a snapshot of your project.

Related

Why is xCode asking for Android Studio Gradle files?

I had to delete Android Studio off my MacBook Air to free up space for an xCode update. Now xCode is complaining its missing Android Studio files that have nothing to do with it but are somehow titled
file:///Users/administrator/Documents/Retrographic/Sprocket/Android/Gradle%20Binaries/gradle-2.2.1/lib/plugins/xbean-reflect-3.4.jar: warning: Missing file: /Users/administrator/Documents/Retrographic/Sprocket/Android/Gradle Binaries/gradle-2.2.1/lib/plugins/xbean-reflect-3.4.jar is missing from working copy
What the heck is this and how do I fix it? I tried re-downloading the branch in SourceTree and pointing xCode at it but its still having the same problem. Do I need to just nuke and re-install xCode?
:(
This seems very unusual...
My best guess would be to go through your various build settings in your project targets and ensure that this file isn't listed under anything for linking, building, etc.
If it is, delete it, provided you don't need it for your XCode project.
This error occurs as that file was under your version control system such as git and now it is removed. xcode checks the status of git and complains if a file was removed. You can go to your version control system and commit this change so that xcode doesn't complain. If you are using git, you can do the following:
git status
--> This should tell the file was removed
git commit ...
Some possible solutions.
Solution 1
Open your xcodeproj/project.pbxproj in a text editor
Search for "xbean".
Remove that line.
Solution 2
If you are using an xcworkspace, there may be some other project that is including that file. In that case, I'd do that for all project files. If that is infeasible, do a grep grep -r xbean . and then edit the named files. This command will recursively search for all files mentioning this particular file.
I'm not sure why is this happening, but i think there might be some file references in your project which are no more existing.
You can try this:
Search and delete missing files.

Xcode 7 not working properly with source control

I just updated to Xcode 7, all system is updated, including command line tool, repaired disk permissions. And I still have several issues with that Xcode.
I am using GIT, but when I launch my project Xcode is ALWAYS asking me to upgrade to Subversion 1.7 even when I click on "Don't warn me again for this workspace" he does not remember.
When I quit and relaunch Xcode do not use my credential for GIT when I push he ALL the time ask me to type them.
When I go to preferences it builds up a stack of ghost buggy accounts...
And when I go to github, I realised that Xcode do not send my user.email when committing and pushing as I got a default email of ganzolo#noreply.github.com.
It's really annoying and buggy, does anybody have a clue?
I've removed SVN but still when I am doing a regular commit from command line (Git uses my user.email), when I am doing from Xcode he send like anonymous, really annoying.
You must have a subversion repo in your source tree, possibly in a 3rd-party library, that you are unaware of.
Go to Terminal and do this to upgrade it:
$ cd /path/to/sourcetree
$ find . -name .svn
If you get a hit then:
$ svn upgrade path/of/svnrepo
Better still dump the .svn directory and use git all the way through, if this 3rd-party library is also part of your permanent source tree.
Thanks to this post I found a solution :
https://stackoverflow.com/a/32546171/706189
It appears that Xcode have a bug and do not read global user.name and user.email. Therefor you need to set it locally in your root folder project.

"Missing File" warning in Xcode 5 & 6 in iOS

I am working with Xcode 6. I am creating new project & adding some files in my project, again i deleted that file with "Remove Reference" click and adding some new files according to my requirement. But when i run this App in Xcode 5 then its showing 2 warning with "Missing File" but if i run with Xcode 6 then its showing so many warning.
How Can i resolve this warning.
I share my screenshot how i deleted file.
This is my warning image
I googled but i got all answer with SVN but i am not using svn and my project also not in SVN server. So without SVN how can i resolve this.
Please help me.
Run the shell script below in your SVN repositories path:
for missingFile in $(svn status | sed -e '/^!/!d' -e 's/^!//')
do
echo $missingFile
svn rm --force $missingFile
done
I can resolve these Missing File warnings just by doing an SVN update (Source Control -> Update), typically after a Commit.
Go to Project Folder then right Click on it
then Delete the XCUserda
Xcode's source control was the culprit for 546 "missing files" warnings on any new project I created. Somehow it searches for the files of other projects I have in a remote SVN server.
In Xcode preferences, source control, I disable it entirely. Now I can create new projects without receiving missing files warnings.
Xcode's source control seems not to work so well, or at least it's not so clear about the way it does things, so I prefer external options to manage my repositories.

Version control in iOS for an update

I recently released an app to the app store, and it works pretty well, but there were a few errors that I need to fix in an update. Namely, sometimes the score doesn't save correctly, and users cannot listen to their own music in the app. I never used version/source control when building the project, and I never used github.
So, I'm wondering if I should save a copy of the current version before updating it, or if the archive (created when I submitted the project to iTunes connect) is a suitable copy of the project (or is the archive in binary?)?
If the archive does not work as a copy of the code I can revert to (because it is in binary), are there any recommendations on how to save this working version of the app? Also, should I change the plist version before making edits?
Thanks. If this question is unclear just comment and I will try to explain better.
The best answer is simple: use a dedicated software version control system.
Use Git.
Git documentation and getting started help.
It's very easy to get started, even if you already have a ton of code.
$ cd ~/path/to/project
$ git init
$ git add -A
$ git commit -m "This is the version that is currently on the store"
Done.
Alternatives:
Create a copy of your Xcode project folder.
An Xcode archive is not good enough because you may need to revert back your code.

Xcode bot: cloning multiple repositories before build

I have three repositories for my current project. They contain some shareable core functionality and individualized components:
MainApp.git
Components.git
Controls.git
The xcworkspace lies in MainApp.git and links to its own xcodeproj file as well as the other xcodeprojs in the two other repositories.
When creating a bot in Xcode server, there's only the option to select one repository for cloning. This lets the build fail eventually, since it cannot find any resources needed from the Components.git and Controls.git.
How can I achieve a working build with my workspace configuration?
You could:
1) Add all the code to the main repo (I highly advise against it)
2) Use a dependency manager such as Cocoapods, where you would have to create podspecs for your dependencies. If they are open-source great they are probably already in GitHub in Specs. Integration between Xcode bots and Cocoapods is kind of broken right now. You could have a pre-build script running the command:
pod install
Amongst other things. See here
3) Use git submodules. They can give you some headaches but they usually do the job when it comes to managing enterprise dependencies. Once again, unfortunately, they are completely broken in Xcode bots:
Xcode bots with git submodules
Problems with Xcode Bots
The list is large, a mere search on twitter for problems related with git/cocoapods and Xcode bots will show you how frustrating it can be.
My personal opinion, if it is a small project and you want to see what Apple's been up to, Xcode bots are great, also the built-in integration inside the IDE is amazing and something to look for in the upcoming iterations.
However, if the project is complex, with some dependencies, maybe UI Automation, integration with Testflight/HockeyApp, etc, I would go with either Jenkins or Travis CI.
Stick with something that has a great community, years of development, plugins..
I was looking for this answer myself, but was not satisfied with the suggestions.
Turns out, it is possible to do everything inside Xcode with just a little helping from the Terminal.
I detailed it here: http://swiftrien.blogspot.com/2016/04/xcode-server-and-multiple-repositories.html
But will summarise here.
1) Create a workspace directory. None of the projects to-be in the workspace should be in this directory (or any of its subdirectories).
2) Using Xcode, create the workspace. You can add the projects now.
3) Exit Xcode.
4) In Terminal go to the workspace directory and do "$ git init"
5) Add a ".gitignore" file with ".DS_Store" and "xcuserdata".
6) Add the files with "$ git add ."
7) Commit the files with '$ git commit -m "Initial commit"'
8) Exit Terminal, start Xcode and open the workspace
9) Use the "Source Control" menu to verify that you now have a git repo for the workspace.
10) Use the "Source Control" menu to add a remote repo on the server.
11) For all projects, use the "Source Control -> Configure ..." menu to tell Xcode that that repo is necessary to include in the checkout.
You will need to create new bots or upgrade the old ones.
Good luck.

Resources