Scanning For Working Copies...

Xcode hangs forever on this step, blocks Indexing

Is there a workaround?

Replies

I'm having the same issue, the only workaround I've found is to disable "Source Control" in the preferences.

If you quit xcode then start it again, it seems to complete the scan, but does not recongize versions. For me it appears that indexing and scanning are locking each other up.

In my case it's a bit random on a restart, sometimes it indexes sometimes it doesn't. But the constant is that I can't do diff or look at blame information in the Version Editor, it's always blank. I need to investigate a bit more before filing a radar…

What I thought was a complete failure, turned out to be somewhat random. Some projects work and some do not. I cannot find any correlation to type of project (swift or objective-c), xcode 7 GM, xcode 7.1 Beta, or repositories. When this started happening I deleted all repositories from xcode -> preferences -> accounts. After that for the projects that worked, the account repositories were automatically recreated, for projects that failed, whey were not.


EDIT: Manually adding the repository did not help. Xcode started the scanning and went on forever.


EDIT: Deleting, then resintalling Xcode did not help. Nor did reindexing the disk, or repairing permissions.


Radar: 22676804

When this reproduces, can you open Activity Monitor and see if you see any processes with the name:

com.apple.dt.Xcode.sourcecontrol.Git

or:

com.apple.dt.Xcode.sourcecontrol.WorkingCopyScanner


If so, do they appear to be using a lot of CPU? If they do, could you open a bug and attach the samples (highlight one and then in the "gear" menu press "Sample Process" and then save the file)? Additionally, any information about the remotes being used by the repositories of the projects in question would be useful (https vs. ssh, public service vs. intranet server, etc.).

I am experiencing the same issue and I located and sampled com.apple.dt.Xcode.sourcecontrol.WorkingCopyScanner. Results saved to pastebin: http://pastebin.com/gVu4EQjs

Nope neither is using any excess CPU. com.apple.dt.Xcode.sourcecontrol.Git was using between 0.5% to 1.6%. Did not see the other one. Remotes with problems are both local file repositories and http repositories.

I am experiencing the same issue in the public release of Xcode 7, and the only workaround is to disable source control in Preferences. Anyone else found a better solution?

I'm having the same problem. Very random. It worked for a day and back to "Scanning for working Copies" error. So frustrating.

I've been getting this too...

How I solved this is basicly disable the source control in the preference for XCode and so it will finish indexing. Then I reenable the source control and everything is good.

I got sick of seeing the 'Scanning for working copies'. There was a process using up CPU when Xcode starts, called socketfilterfw. So I tried turning off the filewall to see if that helps, and it did! Now, look in the firewall exclusion list for an entry called 'XCodeDeviceMonitor' and make sure 'Allow incoming connections' is enabled. Totally fixed the problem. Not sure why it was blocked, I must have done it accidentally.

Did not work fo rme. Although, like you, I did notice that socketfilterfw was running excessively during the time in question.


Did you do anything else like restart Xcode, turn the firewall back on, or reboot?


I tried with both the firewall on and off, both Xcode and XCodeDeviceMonitor blocked or allowed, restarting Xcode each time, and even clearing clang module cache, Xcode cache, and derived data directories. In all cases, after waiting for the scanning to complete, I could still not get any information in the Version editor, or Source Control -> History view. Scanning for working copies would complete when the my project was loaded, but would run forever in the Source Control -> History view.

Well, the project is fairly complex and has a bunch of subprojects under different git repositories, and I did try at various times 'cleaning' the subprojects (removing the xcuserdata), as mentioned on stack exchange. Turning the firewall off was the only thing that worked, with only a closing of xcode, waiting for the socketfilterfw to stop, and starting xcode. Boom, no more scanning for working copies.

Turns out I spoke too soon. After 2 days of peace, Xcode has thwarted me again, and 'scanning for working copies' is back with a vengence. Firewall makes no difference anymore. Although I think it's related, there must be something else going on.