天天看点

[转载]xcode 4.2 配置 svn

刚才遇到了较新的xcode4.2版本中配置svn的问题,查找了挺多的资料才最终得以解决的,在此总结下配置过程。

(1)以创建一个新的工程为例,首先,打开Xcode 4.2,打开windows-> Organizer ->Repository,在点击屏幕左下角的“+”按钮,选择“Add  Repository”。

[转载]xcode 4.2 配置 svn

(2)在弹出窗口中,填写svn服务器的相关信息:Name可以根据你自己项目的名字来起,Location填你的SVN服务器上对应的项目的地址,type选Subvision,如下:

[转载]xcode 4.2 配置 svn

(3)如果svn服务器连接正常,则会弹出窗口让你输入用户名和密码,如下(我的是没有提示,如果你的也没有提示,不用管他,可以跳过这一步):

[转载]xcode 4.2 配置 svn

(4)点ok后如果通过验证,则会弹出窗口让你配置trunk, branches, tags的对应目录,如果你在svn服务器上已经分别建立了同名的这三个目录,则不需要修改此处,默认即可,如下:

[转载]xcode 4.2 配置 svn

(5)此次配置已完成,查看窗口左边TestSVN的repository,旁边应该有一个小绿点了,同时点一下root目录,应该可以在右边的窗口中看到服务器上的branches、tags和trunck等目录(没有的话就点一下refresh按钮),如下:

[转载]xcode 4.2 配置 svn

(6)至此,我们的xcode和sSVN服务器就已经连接上了,下面,就和你在本地使用Source Control没多大区别了。

(7)如果第(3)步中也遇到了没有提示账号密码的问题,可以采取如下方案:

1.将repository URL在safari访问.

2.在弹出的证书界面,选“显示证书”.

3. 在弹出的证书处打勾并继续.

4.重启xcode,对应的repository就变绿了:

(8)如果第(7)步也不行,还是无法commit,并显示红点,不要着急,可以采取如下方案:

1)打开“终端” ---(英文:open a terminal)

  2)输入 <code>&gt;svn checkout SERVER_PATH FOLDER_PATH_TO_PUT_THE_PROJECT (实际是 svn checkout https://xxx.com/xx xxProject)  其中,</code><code>https://xxx.com/xx这个为服务器端地址,xxProject为项目名 </code>

3)系统将提示你输入密码,随便输入一个,然后回车

4) 系统提示你输入用户名,输入正确的用户名

5)系统提示你输入密码,输入正确的密码,然后项目将会被checkout.

6)这是你可以关掉该窗口了

7)重新打开XCODE,就可以看到refresh后就搞定了。

&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;

解决方法(原文):

There are a lot of links, but no solution posted directly here, so I'll do it.

The reason Xcode4 does this is that it tries to log you into the SVN server with your mac credentials. When that fails, it basically just hangs and fails. The best solution I've seen so far is this:

open a terminal

If you don't have the project out do this:

<code>&gt;svn checkout SERVER_PATH FOLDER_PATH_TO_PUT_THE_PROJECT</code>

It will then ask you for password for the mac username, you just write anything or nothing and press enter.

it will then fail and ask you for a username. Enter the correct one and then the password when it asks.

The project will be checked out, but you can just close the terminal window and delete the folder again if you want. Xcode4 willnow connect without a hitch. :)

以上就是Xcode 4.2使用SVN进行代码管理的主要方法,其实不太复杂,主要是Xcode以前版本中代码管理是专门有一个SCM的模块的,在Xcode4.2下,此功能集成到organizer下的,所以不少人觉得一下子摸不着头脑了。

s5pc110烧录

网络上志同道合,我们一起学习网络安全,一起进步,QQ群:694839022

继续阅读