Moving Xcode project onto another machine - How do I handle files referenced from outside the project folder? - xcode

thanks for taking a look.
I had bought the cheapest Mac Mini I could so that I could do some iOS dev, and my project has outgrown it. So I bought a MacBook Pro! It's awesome, uploading my parse cloud code took 15-20 minutes on the mini, and is instantaneous on the MBP.
However, I'm having trouble getting my Xcode project to build. Some of my frameworks are red in the Project Navigator, and I notice that their paths are /Users/[account name]/Documents/Downloads/[framework files]. It looks like on my mini I had created references instead of copying the files into my project.
I know it's against protocol here, but I haven't attempted much out of fear of breaking something. I have tried some googling, but I haven't found any relevant info. I may just be searching the wrong stuff, so feel free to mark this as duplicate and send me on the right path.
I'm using github to host a private repo for the project. What steps should I take to properly move the necessary files into my project folder, re-push the project to github, and pull back onto the other machine?
I am not going to be working from the mini anymore, at least on this project, so if it's easier to copy the file over the the MBP, put it in the project folder, and change the reference or something similar, I can do that. And I haven't made any changes to the code on the MBP, just worked on resetting up signing identities / provisioning profiles. I can always pull the project again if something gets mucked up there, but I'm nervous about changing stuff on the mini, breaking stuff, and not being able to build out my project at all.
Any tips on moving forward before I try stuff myself? Again, sorry that this breaks protocol for posting, I just want to avoid breaking my project... this isn't something a simple undo could fix, and I can't risk losing the entire project because of something stupid.

I would do this:
make sure all your projects are in source code control and committed -- good practice.
backup MacBook Pro (time machine), just in case.
copy the external dependencies over to new MacBook Pro in a way that makes sense.
one by one, delete the red frameworks and re-add them to the projects. Your choice as to copy vs reference.
Afterwards, I'd consider migration to something like Cocoapods for management of dependencies. I say consider because that's exactly the state I'm in - considering this option.
This should move you forward fairly safely. Best of luck!

Related

I lost an Xcode Project

Is there any way I can recover a deleted Xcode Project? One night I was making updates and the next morning the whole project was gone. Couldn't find it in the recycling bin or anywhere. The project was synced in my iCloud drive.
The app still runs in the simulator. Is this a good sign? Thanks for any help!
AFAIK, you can't.
Well, if it was sync to iCloud drive, then you can get it back from iCloud (I think so, since I never use that feature to backup). The app in your simulator doesn't help, since the code there was already compiled to machine code and unable to extract back to your original code.
Next time, make sure you have backup methods, like using source control (git, svn...) or zip and clone to drive. Good luck. Sorry for your lost, I know that feeling.

OpenFrameworks setting for latest xcode_How can I make a new project?

I started OpenFrameworks for fun :D
However, setting OF in Xcode is little bit confusing.
According to web search, just copy and paste Example and edit that project.
It is little bit uncomfortable since workspace location is restricted.
Now I am curious is there any tutorial which start with xcode - [new project]?(I mean xcode UI)
So I can make OF Xcode workspace anywhere I wanted.
A Link can be very granted.
Thanks for answer:D
PS. If you do not mind please attach answer as answer section, not in reply, so I can close this question.
I'm a bit confused on what you mean with workspace location is restricted, do you mean that the location where you can put your project is limited?
Generally all projects in openframeworks are being put inside the apps folder of openFrameworks. Technically it is possible to take a project out, but it's not recommended.
You can both have a structure like this:
openframeworks/apps/myApps/myNewSuperOfApp
or
openframeworks/apps/someProject/myNewSuperOfApp
Copying the example is one way of creating a new project, but a easier way (sometimes) is to use the project generator that you find in projectGenerator_osx
You do not want to create an empty project in xcode and, then add openframeworks to it. The projects that are generated with the project generator (or the examples) have a lot of settings that are needed in the xcode project for them to compile with openframeworks. It's not something that you easily can add to an empty xcode project.

Xcode 5 and shared Schemes

I'm having an annoying issue with Xcode 5 and the shared schemes.
In my team (we're just two, but hey! it's still a team) we're sharing some Schemes to run the app with different configurations (Debug, QA, Release, ...)
Well now Xcode 5 seems to change the BlueprintIdentifier setting of each scheme based, from what I can understand, on the machine of the developer. And of course the change get's noticed bit git and we either have to checkout them, or commit. Both solution don't make sense...
Any idea on how to fix it? I did a google search but found nothing for Xcode 5...
I don't want to give up on those shared configurations! A solution I can came up with to keep having the shared Schemes tracked is unshared them, copy them in a dedicated test folder, then using a strategy like the one used for the Pods to copy those schemes locally, where Xcode can mess up with them without us noticing. Something like a schemes script that reads a Schemefile file which lists the schemes to copy from the Schemes/ folder, and a Schemefile.lock that is updated every time there's some change and that is read by the Xcode build process in order to make sure everything is up-to-date.
This seems a lot of work for such a tiny thing, so before jumping head down into it I would like to know if anyone has some better solution to propose.
Cheers :)
First, I'm assuming you're using CocoaPods because you mentioned it in your question.
I've had this issue for a while and just recently discovered that some of my shared schemes are not getting their BlueprintIdentifier changed with the others. Upon investigation, I noticed that the untouched schemes had a Pods target under builds that was missing–as in it was listed in red like this: Pods (missing). My theory is that pod install and various Xcode events (i.e. crashing, launching, etc) were causing the scheme to change its BlueprintIdentifiers because they had a reference to a Pod target in the scheme build settings.
I removed the Pods reference in all of my schemes and have not been able to reproduce the BlueprintIdentifierchange since. My target that depends on Pods has libPods.a specified under Link Binary With Libraries in Build Phases and set to required, so it still gets compiled before the main target.
Note that switching between branches with this change and without this change might still produce modifications to the scheme files.
#Wes's answer didn't specifically fix this issue for me, but it did lead me to the right place. The solution for me was to turn "Find Implicit Dependencies" from "off" (unchecked) to "on" (checked) from the Edit Scheme screen for the Scheme that keeps changing.

Why is Xcode's Search Navigator searching the wrong project's files?

I have a large Xcode project for a game I'm building. I recently switched versions of the animation framework I'm using (cocos2d), and to keep things clean, I went ahead and created a brand new Xcode project from scratch.
Afer creating the new project file, I made copies of all my source files in the filesystem, then symlinked them into the new project by dragging them into the Xcode Project Navigator. Everything worked fine.
But here's where it gets weird. Whenever I use the Xcode Search Navigator to do global text searches on my project, it searches files from the old project! And only files from the old project!
The only conceivable explanation I can come up with is that Xcode is somehow recognizing my filenames as being the same as were used in the old project, and has decided to ignore the newer versions in favor of the old ones. Is there any such cache or preference within Xcode that can do such a thing? Keep in mind the paths are different, since the new project's files all exist in a brand new directory. But the class names are the same.
In case this is relevant: I once created an Xcode Workspace that included the old version of this project (but not the new one.) I abandoned the workspace long ago as it was problematic, in favor of working with the project directly.
UPDATE: This appears to be an Xcode-related problem-- I have discovered I have the same lack of search-ability in all of my projects. I uninstalled Xcode (I had the version that was still using the Developer directory) and installed the latest version (4.3.3) that does not use the developer directory, but I am still seeing this problem.
I am curious if anyone knows a way to wipe out Xcode's cache of project code indexes, if such a thing exists, that might potentially "reset" its knowledge of my projects and thus fix the situation. Possibly something in the Library directory?
One last clue as to what might be happening: In addition to the search navigator failures, I noticed one of my projects was still using resources that no longer existed in the filesystem-- again, making me think Xcode has cached information about my projects somewhere and is now using outdated versions of my files that no longer exist. this post helped me solve that problem by resetting the simulator's content and settings, but the search issue persists.
Have you checked your Find Options? This same problem was biting me and then I remembered I had added a custom Scope in 'My Scope' that directed XCode to my other project. Changing this back to 'Workspace' fixed the problem.

svn conflict xcode project file while working in team

I'm working in a team that's developing iPhone application (about 7 people). We use SVN for source code control of iPhone code, we keep running into conflict issues with xcode project file and iPhone nib file. I think there has been a question asked about this problem : How to merge conflicts (file project.pbxproj) in Xcode use svn?. I want to ask if anyone has ever come up with a satisfactory solution to this. Since our team is fairly decent in size (7 people), manually resolving conflict in xcode project file everytime someone changes code, or adding new object into nib file is a huge productivity waste. Has Apple engineers ever thought about this issues when they wrote their own iPhone apps ? I have been looking for a satisfactory solution using Google and Bing, not yet found one.
Thanks,
This is definitely a HUGE flaw with xcode. I'm on a team of similar size and here's what I do to make the process as painless as possible:
SVN update (ALWAYS do this before a checkin as well):
quit Xcode. The quickest way to do this is to use Alfred and type "forcequit xcode"
"svn up" in the project folder from command line
If you have any merge conflicts with the project file, hit "edit" to open in emacs or whatever
search for "======" to find merge conflicts; delete that line as well as the "<<<< mine" and ">>>>" lines
save & exit. hit "r" to mark project as resolved.
re-open project - "open MyProject.xcodeproj/"
With a bit of practice you can get this process down to under a minute (I do this several times a day).
for NIB files, DO NOT work on while someone else is working on it. There's no real way to merge them. Make your changes quickly and check in right away (there aren't many cases where 2 people need to work on a NIB file at the same time anyway). For less complicated views, just lay them out programmatically.
Try installing SourceGear DiffMerge. This is a merge tool that should make it a lot easier to merge the changes. Also see this blog post about configure XCode to use DiffMerge

Resources