How to open an existing GitHub project with Xcode? - iphone

I am new to xcode and I want to learn iphone development.
I found one demo project on github, I want to know how to open this existing project?

Download the project via git / or zip
Open folder
Double click on .xcodeproj file
if on the top left, you see a something like "Base sdk missing"
Double click on the first item in the three
Go to tag build
Select a sdk for the Base SDK
Close the opened popup
Click on build an run
If you have error, you should see a red icon on the right bottom

Note: since June 2016, you can open your demo GitHub project in Xcode directly from the GitHub site!
But you will need the latest Xcode 9, announced at the 2017 WWDC
See "Clone in Xcode"
It's easy to explore code in your browser when you visit a GitHub repository, but you often want to pull that code directly into the appropriate editor and try it out.
For example, if the repository contains an .xcodeproj or .xcworkspace file, you might want to open that code in Xcode.
This is possible starting today with the new "Open in Xcode" button.
That will trigger the git clone for you.
Note: as illustrated in "Unable to see “Open in Xcode” button on GitHub", you also have to be logged in to GitHub in Xcode as well.
In Xcode, navigate to Preferences.../Accounts, select GitHub and enter your login credentials.

Using xed ./ios in the terminal of the root of the app worked for me.

Related

How to get a project from Github to Unity

I'm new to both unity and github, how would I go about getting a unity project my group has been working on from github to Unity? I apologize if this is a simplistic question my google searches didn't turn up much.
Just do a
git clone <PROJECT_URL>
A folder with the project contents will be created in the current path. Then you just open it with Unity.
You'll have an Assets folder somewhere inside your project folder, the parent of this Asset folder should be the Unity project folder, so just browse to it on Unity and open it.
#Roberto's answer presupposes that you are familiar with GitHub / the command line.
If you aren't and aren't planning to continue to use GitHub for collaboration, you could also just download a zip archive of the repository (= the project's main "directory"). You'll find a "Download ZIP" button on the righthand side of the repository's main page.
See also:
How do I download code from this github site
How do I clone a github project to run locally?
This can be a little intimidating for new gamedev's who have not been using source control.
Install some sort of tool that supports git.
There are two flavors : command line tools and GUI tools. Some examples would be gitbash, github for windows, or mac os X developer tools includes a git commandline as well. In my experience many documentation examples seem to refer to command line as it is more universal across computing platforms so you may want to use that even if it seems 'harder' at first. The rest of my instructions assume you use a command line tool.
Get the URL for the code to clone.
Navigate in a web browser to the code repository (on Github, Bitbucket, or wherever it is). Usually in the upper right hand corner is a download or clone button. Often it has a drop down arrow that will allow you to get a URL or a zip download. If you want to actively participate in submitting code grab the URL and proceed to the next step. If you just want to download it once and check it out for fun grab the zip.
Clone the repo in your command line tool
Open your command line tool.
Navigate to a folder that you wish to store source code in such as C:\source or D:\repos using the cd commands (you may wish to google this if your not familiar with it as it varies a tiny bit between platforms and the command line you may be using)
Now you want to execute the clone command. Some git repos will have included the clone command in the url you copied, others will not. The end command will look similar to this
git clone https://github.com/someguy/SomeGameProject.git FolderIWantItToGoIn
Hit enter, and it will clone the project. This may take a few minutes if the game project has large files it may take a bit longer.
Potential large assets work arounds
In some cases projects have some very large assets they do not commit to source code. If so you should receive special instructions where to download those.
Hopefully those file instructions are detailed, but if they only mention where to get the files then after step 3 download the files and insert them into the folder under Assets/ will usually be the correct thing to do.
Open UnityHub and open the project in the appropriate version of Unity 3d.
Note that many projects choose a particular version of Unity. Hopefully your team told you what version to use. If not check in the folder you made under ProjectSettings/ProjectVersion.txt . In this file it will say what version of unity was used like this:
m_EditorVersion: 2020.3.8f1
So in Unity Hub click "Add" and select the folder you cloned the project into.
This will return you to the Projects view.
In the projects view select the version noted above in the "Unity version" column with a small grey triangle drop down.
Then click on the project name to open it.
In Unity, go to the Assets menu and select "Open C# Project" and make sure that your code editor loads without error.
Finally, in Unity 3d, open whatever scene file is indicated as the one you should work in and hit Play at the top and you should be able to play the game without error (assuming they checked it in with no errors of course).
In case if you are looking for JAR files of all the dependencies you have in android project. Assuming you have added needed dependencies in you build gradle file(including your github projects), Compile/Make once and Look at Project->External libraries in android studio. You will find list of all downloaded jar files, Copy those and paste it in Unity assets/android/libs path.
Open up your github repository like https://github.com/*Yourname*/*YourGame*
Then click Code=>Download Zip
Then unzip folder
After that Open up UnityHub and and select open project
or
Open Unity then click File=> Open Project
Then chose your project folder that it.

Subversion with Eclipse for android

Okay I am starting to give up with this. I have been trying to setup sebversion in Eclipse for my android project. I have been following the following tutorial
http://blog.bauson.com/eclipse-subclipse-svn-hostgator-com.html
I got the following:
Created a repository called myRep
Created a project under with source files myRep/TestProject and attached it to trunk
installed subclipse and got it to grab the repository
Now when, it says "Checkout as a project configured using the new project wizard", I get to choose the type of project. If I choose android application project then it creates a default android project and nothing is checked out. But when I choose General Project, it does grab the whole thing in the following structure
Repositony->TestProject->Trunk->All my android files and folders
However I want it to be android project so I can compile and run it. I did a lot of googling and I need your help pleeease!
Never mind, I figured it out. Apperently, when you choose the repository you have to right click and click refresh and it will show you a list of Folders (stupid eclipse does not do it automatically). Then you choose your project and create it as a new project. Voilla, you get it compiling and running

How to access SVN repository in XCode 4.2?

Now, i switched to developing from Xcode 4.2. In Xcode 3.2.5 i have used SVN repository to save my project details. But, in XCode 4.2 i dont know how to access SVN Repository? Can you please tell me what are the steps i need to follow to access SVN from XCode 4.2? Thanks in advance.
Windows > Organizer > Repositories > Add Repositories (bottom left +) > Type - Subversion
In XCode 4.4, I had some problems viewing repos that were setup in XCode 4.2. One of the great features of XCode is it's ability to connect to repo and show whether a file has been modified by showing an "M" next to the class file that hasn't been committed yet. When I added a new repo as I had before (the GameBit method), all of my projects stopped showing the "M" or "A" and all the commit messages weren't visible in the Organizer, and my trunk/branches/tags folder were disconnected (red dot).
When this happens, the first thing you should do is close the project and quit XCode. That should reset the svn configs of all your projects.
If that doesn't work, open Terminal and enter this command to checkout your new working copy:
svn co (http or https)://YOURsvnSERVERurl/PROJECTNAME(name of your new project folder you just added to Organizer)
That immediately resulted in all previous projects in the Organizer > Repositories to show the commit messages again and linked everything up as it was before. However, the new project still didn't show the "M" and "A" until I quit XCode and rebooted.
This answer is meant for anyone who tries to add a project under svn to XCode's source control management system and XCode is not showing the commit status.

How to integrate RestKit Framework (restkit.org) with xCode 4?

I followed the instructions on the github page but something is wrong (most certainly is me: P) but, Do you know about any good tutorial for integrate / use in Xcode4 RestKit?
Thanks!
Download the latest version from this Link http://restkit.org/
and extract the zip folder and you will find a ReadMe.md file which explains you steps to install for Xcode 4.x as shown below
Xcode 4.x (Git Submodule)
Add the submodule: git submodule add git://github.com/RestKit/RestKit.git RestKit
Open the project you wish to add RestKit to in Xcode.
Focus your project and select the "View" menu > "Navigators" > "Project" to bring the project file list into view.
Drag the RestKit.xcodeproj file from the Finder and drop it on your "".xcodeproj.
Click on your project's name in the sidebar on the left to open the project settings view in the right pane of the window.
In the middle pane you will see PROJECT and TARGETS headers for your project. Click on your project name, then select Build Settings along the top to open the Build Settings editor for your entire project.
Find the Header Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build" directory you have added to your project. DO NOT check the Recursive checkbox.
Find the Library Search Paths setting. Double click and add a new entry. Add a search path to the "$(SOURCE_ROOT)/RestKit/Build/$(BUILD_STYLE)-$(PLATFORM_NAME)" directory you have added to your project.
NOTE: This is only necessary if you are NOT using DerivedData.
Find the Other Linker Flags entry and double click it. Use the + button to add a new entry and enter -ObjC -all_load. Dismiss the editor with the Done button.
Locate the target you wish to add RestKit to in the TARGETS list in the middle of the editor pane. Select it to open the target settings editor in the right pane of the window.
Click the Build Phases tab along the top of the window to open the Build Phases editor.
Click the disclosure triangles next to the Target Dependencies and Link Binary with Libraries items.
In the Target Dependencies section, click the + button to open the Target selection sheet. Click on the RestKit aggregate target (it will have the bulls-eye icon) and click the Add button to create a dependency.
In the Link Binary with Libraries section, click the + button to open the Library selection sheet. Here we need to instruct the target to link against all the required RestKit libraries and several system libraries. Select each of the following items (one at a time or while holding down the Command key to select all of them at once) and then click the Add button:
libRestKitCoreData.a - Optional. Only necessary if you are using Core Data.
libRestKitJSONParserJSONKit.a
libRestKitNetwork.a
libRestKitObjectMapping.a
libRestKitSupport.a
CFNetwork.framework
CoreData.framework - Optional. Only necessary if you are using Core Data
MobileCoreServices.framework
SystemConfiguration.framework
libxml2.dylib - Optional. Only necessary if you are mapping from XML payloads and link libRestKitXMLParserLibxml.a into your app.
Verify that all of the libraries are showing up in the Link Binary with Libraries section before continuing.
Congratulations, you are now done adding RestKit into your Xcode 4 based project!
You now only need to add includes for the RestKit libraries at the appropriate places in your application. The relevant includes are:
#import <RestKit/RestKit.h>
// And if you are using Core Data...
#import <RestKit/CoreData/CoreData.h>
I found this tutorial very useful to make it work on xCode 4.0.
http://liebke.github.com/restkit-github-client-example/
I did my build following this steeps https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x and guoleii is right. But I needed to change the owner directory.
Have you seen this threads from RestKit's Google Group?
link 1
link 2
Try searching there. But for now, there seems to be A LOT of issues with RestKit and Xcode 4, there's even a YouTube video showing the problems (none showing a how-to).
did you build RestKit according to the wiki page "Installing RestKit in Xcode 4.x" on github.com/RestKit? i think there is a little mistake. here is my solution: 1. in "Build Phases" -> "Link Binary With Libraries", delete the RestKit.framework and add Security.frameWork 2. build again
then it works.
I just tried to install RestKit on a newly created Xcode 5 iOS 7.0 project. I tried downloading the project and following the steps above, but i was missing most of the content with in the RestKit/Vendor folder. After doing a bit of research i did the submodule tactic and that got me all of the information from those folders.
From the command prompt change directory into your project folder, for me it was
$ cd Documents/Projects/NewlyCreatedApp
From there you should run this command if you have no git repository
Note: you must download git to install this, if you have not already
$ git init
after that you must run these commands to download restkit into your project folder
$ git submodule add git://github.com/RestKit/RestKit.git
$ git submodule update --init --recursive
After that, you should go up to Nakkeeran's answer above and start from step 2, to set up the process. In step 7 you will be asked to add "$(SOURCE_ROOT)/RestKit/Build" to your header search paths, but upon closer inspection the RestKit framework no longer has the build folder so you should change that to "$(SOURCE_ROOT)/RestKit/Code" to fit the current version of Rest Kit
I hope this helps, and here is a link to the submodule information i posted.
RestKit Installation Submodule Method

linking gdata to an xcode 4 project

I'm having major issues linking gdata to a project after upgrading from xcode 3.2.5 to xcode 4. I would like to know if anyone is having similar issues, and what did they do to resolve them. i am using gdata version 1.11 which is the latest on their site. The project works flawlessly on 3.2.5, thanks.
I have created a workspace for my project, and then added the gdata.proj to it. So I do have all the files linked by reference. But project files which include #import "GDataYouTube.h" do not see the file. I get "No Such File or Directory"
Good News... resolved and tested, all working follow these steps...
Open your project in xcode 4 from 3.2
click File -> Save As Workspace
in project navigator on the left, collapse your Project if you see all the files
below your collapsed project, in the empty space right click or control click -> Add Files to...
select the project file you wish to link to, leave Copy items unchecked, click Add
Now you will see 2 collapsed projects in your Project navigator, expand both
Now what I didn't know I had to still do
Drag the files or folders you want from the second project to your main, make sure your Main project target is selected in the options, and I also have group selected then click Finish
You are good to go, you might have some warnings about your second project and its targeted SDK. Fix those by clicking the project name in the Project Navigator -> Build Settings -> Base SDK to 10.6, Deployment Target to 10.5