Gokul
Gokul

Reputation: 1226

Can't access Mac server from Xcode

I wanted to create a remote repository in my Mac server. I have installed the app, configured and started the Xcode service as per the Apple docs. But when I try to add the server to my accounts in Xcode, the server name is there, but on adding, it is giving the following error.

Unable to perform the request. CFNetwork error: The network connection was lost. (-1005 - kCFURLErrorNetworkConnectionLost)

The server is hosted on the same Mac in which I am developing.

Upvotes: 1

Views: 571

Answers (2)

yo2bh
yo2bh

Reputation: 1436

Just do the following steps :

1.Remove your Server from Xcode
2.Quit Xcode
3.Restart/Shutdown machine (If I don't restart/shutdown machine, unable to add server again in my case)
4.Open Xcode
5.Add Server again

This Solution works for me, but its not proper solution. It's headache to repeat the above steps every time while facing same issue, I research more on this but did not get any proper satisfactory solution.

Upvotes: 0

DragonTheHorse
DragonTheHorse

Reputation: 67

I've run into the same issue (my server is on the LAN but it had previously been working).

I'm assuming you've got a Git repository created locally and you want to push it to the server. I'm using Xcode 8.2

The only 'solution' I've found so far is to manually create the remote from the Mac Server app (you could also do it on the command line if you want). The steps I used:

  1. Go to the Xcode section of the Server app, select 'Repositories' on that screen, then the + button to add a repository with the name you specified.
  2. After doing that; go back to Xcode proper and with your project selected Open the 'Source Control' menu, select your repository then click 'Configure '
  3. In the resulting dialog, select the 'Remotes' tab
  4. Click the '+' button and select 'Add remote...'
  5. Another dialog comes up. For 'Name' use the same name as you did in the Server. Address should be whatever Server->Xcode reports for the repository you created (something like ssh://hostname/git/MyRepositry.git).
  6. Click 'Add Remote'
  7. Click 'Done'
  8. You should now be able to push/pull between your local and remote repository.

Not the best solution, but as I say, it's the only one I've found so far. Quite a few people seem to be asking this, but none of them seem to have found better answers either. To find some of the other people reporting the problem, I used the following search term in google:

git unable to perform the request cfnetwork error the network connection was lost xcode 

Upvotes: 2

Related Questions