Version control in iOS for an update - ios

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.

Related

Xcode 6: What to ignore when committing to SVN so the application can later be checked out and runnable without any extra work?

I want to commit the minimum amount of files and still be able to checkout and have it working without ANY work. This will be specifically used for a Phonegap iOS application. However, any relation to iOS apps will be great.
Essentially you may ignore only the builds/ folder as the files in there are generated every build. Have been working in a project with other develops having only this folder .gitignore'd.
If you wish, you may ignore several other files to make your repository as clean as possible.
Another way to commit as little as possible is to use external library managements, such as CocoaPods. Just remember to ignore Pods/ folder and run pod install when first running the project on a new computer.

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.

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

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.

Cordova project from .zip fails to build ios, tries to write to directory from other computer

After successfully creating, building, and emulating Cordova's Hello World project, I unzipped the project folder that I am taking over from another developer on a different machine and saved it locally. While I can run the iOS app from XCode with the built project from the previous developer, I can't run the $ cordova build ios command successfully to rebuild it on my machine.
It give the following output:
The following build commands failed:
Check dependencies
Write auxiliary files
When I run it in debug mode, I notice that both of these commands are trying to make a directory for the old dev's computer (/Users/hisName/whereHePutIt/CordovaProject/stuffItIsTryingToBuild) rather than one relative to my project folder (/Users/myName/whereIPutMine/CordovaProject/stuffItIsTryingToBuild).
There is a lot of text to comb through, but it looks as though it is always failing while attempting to make a directory in /Project/platforms/ios/CordovaLib/build/CordovaLib.build
I am really stumped by this because I can't find any sort of setting or file in the project that tries to write anywhere but a path relative to my project file, and Android builds and emulates fine.
I had a similar issue on Android actually. My home for sdk tools moved but the project still wanted to use the old sdk tools.
The solution I took was to remove the platform and then re-add it. I am sure there is a way of going through the existing files and patching this, but everything you should need is in the plugin/ and www/ and where ever you elected to keep your assets.
If you do try this, make sure to create a backup before removing the platform -- it would be awful to lose changes that someone might have jammed down in the platform/ios folder.
I just ran across this issue under similar circumstances - unzipped a zipped copy of a iOS Cordova app from a coworkers computer to continue developing it, and found I could not successfully run the cordova build command.
I managed to get this to work by deleting the old "Debug-iphonesimulator" folders that had been zipped up with the rest of the project from the other computer, and then re-running the build command.
There were two folders that I deleted:
"../ios/CordovaLib/build/CordovaLib.build/Debug-iphonesimulator"
and
"../ios/build/ProjectName.build/Debug-iphonesimulator"
Hope this helps someone!

How to enable Source Control in existing iOS project?

As in the topic - i have a project that doesn't have Source Control enabled, so how (and if) can i enable it now? I use Snapshots but the project became a big one, and now i need some more "pro" tools. I'm still rather an xcode beginner, so please explain it like i was a cow.
First off you'll have to install the command line tools for github. You can do so from this link http://mac.github.com/, then either during setup it will ask you to install command line tools, or if it doesn't, you can do it from the preferences menu. Once this is completed, you will be able to follow the instructions on this website to convert your project: conversion tutorial. After all that is done, this website explains everything you could possibly want to know about Source Control and all you can do with it.
EDIT
If you do not want to install github for the command line tools, you can install Homebrew, which is a package manager (macs equivalent to apt-get), then run brew install git for the latest version of git.
After doing a git init,go you the projects tab in the Organizer (top right corner in xcode) There remove the reference to your project and restart xcode to update the changes. Removing the project from Organizer will not delete any files, it will only clear the caches.
I am not sure how to do this from within XCode, but if you are on OSX you can easily initialize git from the command line (within Terminal). From the base directory of the project invoke git init.
Once the project is associated with a git repository, XCode should recognize that and you will see the project listed among the repositories in XCode's Organizer (available from the Window -> Organizer menu)
To upload the project into github, look at the directions here: https://help.github.com/articles/create-a-repo

Resources