For example:
Any ideas?
MacOS High Sierra 10.13.1
Xcode 9.1 9B55
As KellyTheDude mentioned, renaming or moving the Xcode.app will fix the issue on OSX 10.13 (High Sierra) since /usr/libexec/xpccachectl (the preferred solution) does not seem to exist under this version of the OS. To fix quickly:
Rename Xcode in the applications folder temporarily.
Name it back to Xcode
UPDATE: This fix also works on macOS Mojave (10.14) and Xcode 10
UPDATE: This also fixes the Xcode Source Editor not showing up in System Preferences under Extensions (for Swiftify, etc.)
Oddly I was able to fix this by moving my Xcode.app to Applications. I originally had it nested in a subdirectory under there to version it, but alas, someone must have hardcoded a path somewhere.
I fixed this by quitting Xcode and deleting all the files in directory ~/Library/Developer/Xcode/DerivedData/.
This happens to me once in awhile and deleting derived data and restarting Xcode doesn't work for me. I usually have to do the following:
Close Xcode
Execute command in terminal: sudo /usr/libexec/xpccachectl
Restart my computer.
Restarting the computer is a required step.
Source: Apple Forum
I had the same issue with Xcode10.1.
All Answers here did not work for me.
I was able to solve this issue only by reinstalling Xcode.
Delete Xcode10.1 and empty trash.
Delete all files in ~/Library/Developer/Xcode/DerivedData/ directory and empty trash.
Restart Mac.
Download and install Xcode10.1.
Step 1:
Xcode > Preferences > Key bindinds > Now Search for "Documentation" in search bar you will see key for Add Documentation
Step 2:
Double click and assign new key as "Alt + Control + /"
Result: It will work now but if you want to change it back to what it was (Alt + command + /) you can do that.
Also, this will enable the Add Documentation in Editor > Structure
Its a hack and worked for me.
Related
It looks like XCode came out with a new update. This issue seems to be persistent where the iTunes Store does not render the update even though it posts it in the "Updates Installed in Last 30 Days" section. After I restart, I am then prompted to update again even though I have already done it twice. Ultimately, the update does not apply when I open XCode (it still shows 7.3, not 7.3.1):
There is only one way! For this you need:
1. Delete the XCode 7.3 from Applications folder
2. Download the Xcode 7.3.1 from here
3. install it manually
That's it))
A possible method of resolving this issue which has worked for people including myself, is as follows:
Close App Store.
Using terminal type the following:
open $TMPDIR/../C
Locate and then delete the folder named com.apple.appstore
Empty Trash folder, if you get an error message saying that files are in use try the following:
sudo rm -rf ~/.Trash/*
Restart Mac.
Once you have restarted your Mac try to install the update.
If this does not work delete Xcode from /Applications and repeat the above method.
I just upgraded to Mountain Lion (from Snow Leopard) so as to take advantage of Xcode 4.
Before installing Xcode 4, I would like to remove Xcode 3 (not required, but want to clean up before moving on).
The standard method of removing Xcode 3 is:
$ sudo <Xcode>/Library/uninstall-devtools --mode=all
However, when I issue this command, even from within the /Library folder, the only thing that happens is I get a "command not found" after entering my password.
I can see uninstall-devtools in Finder, so I know it's there. I just can't execute it for some reason. I've tried every possible way of running the uninstall tools.
Assistance is greatly appreciated. Thanks.
If the file really is there, type sudo in the terminal window (with a trailing space), drag and drop the uninstall-devtools file on the window, then append --mode=all. That should clear any chance you have to make a typo or any other mistake.
Similarly to information I found in another SO article, my laptop's old XCode 3.2 didn't even have the uninstall-tools utility.
So it worked fine for me to simply delete the XCode.app folder.
When I try to search the documentation within Xcode I get the following error:
“index.html” is locked for editing and you may not be able to save your changes. Do you want to unlock it?
“index.html” is currently locked because it does not support editing.
The file “index.html” could not be unlocked.
Could not add write permission to the file because you do not own it. Try modifying the permissions of the file in the Finder or Terminal.
I have tried uninstalling and reinstalling without success.
Any ideas?
Here's a solution I found on Apple's DevForums:
I went into Xcode preferences, went to the Downloads option, and
selected Documentation. From there, I clicked 'Check and Install Now'
and it went and downloaded the iOS 5.0 library and 10.7 library. Once
those were downloaded, help seemed to be working again via the local
libraries. Hope this helps get you back on track.
And yes, I've seen the same problem that you've seen. You just need to fully download the documentation.
Update: xCode 4.2.1 fixes this problem.
I worked around the issue in Snow Leopard this way:
Open XCode
Open the organizer ( Window | Organizer )
Select Devices | Provisioning Profiles
Select my phone-provided provisioning profile and click Refresh
You do this silly thing because XCode will then display a dialog asking you to sign in with your Apple ID. If I sign in /here/ instead of on the page in the documentation, it remembers I'm signed in, shows the documentation when I ask, and doesn't crash. I have to do this every time I restart XCode, though.
YMMV.
Simple answer... Have you tried repairing permissions?
How about deleting xCode prefs?
You can chown the documentation to your user, attempt to search, unlock the file, and then chown the documentation back.
Unfortunately, you have to search and unlock for each file individually.
sudo chown -R `id -un` /Library/Developer/Shared/Documentation/DocSets
# Try to search; unlock the file.
sudo chown -R _devdocs /Library/Developer/Shared/Documentation/DocSets
I don’t think it actually modifies the file — I suspect this is a problem with the new versioning feature.
This has helped:
Become super user
% cd /Library/Developer/Shared/Documentation
% tcsh
foreach i ( `find . -name index.html` )
echo $i
xattr -d com.apple.quarantine $i
end
I still get the following on the first search:
Internal Error
Xcode encountered an internal logic error. Choose
"Continue" to continue running Xcode in an inconsistent
state. Choose "Crash" to halt Xcode and file a bug with
Crash Reporter. Choosing "Crash" will result in the loss of
all unsaved data.
[Show Details] [Continue] [Crash]
I pick [Continue] and everything works fine afterwards.
the Better solution is Uninstall Xcode:
sudo /Developer/Library/uninstall-devtools –mode=all
after that, install Xcod
So, I opened a xib file from an older project and it caused a crash. That's not the issue. The issue is that now when I restart Xcode, it tries to open all previously opened projects (and files) and the crash re-occurs. Where does Xcode store the list of previously open files, and how can I get it to start 'clean' without any open projects?
Update: As a note - this is the latest version of Xcode 4.2 on Lion.
Press option+Shift when clicking on the Xcode icon in the dock. Xcode then starts without opening previously used projects. This is related to version Version 4.5.2 (4G2008a) but I am almost sure that I used it in older versions as well.
I've recently had a similar problem. I tried the methods above and could launch Xcode from the command line, but as soon as I tried to open from the finder, it would try to open the "bad" document and hang.
I eventually resolved it by removing the contents of :
~/Library/Autosave Information/
~/Library/Saved Application State/com.apple.dt.Xcode.savedState
This seems to have fixed it for me.
I just spent half the day stressing over a very similar issue. I had tried updating and reinstalling Xcode - but the problem still persisted. Thankfully, a few minutes ago, I managed to solve this by doing what your question states with the help of this post.
Basically, I opened another Xcode project (it can be any file, though) from the terminal using the following command:
open -a /Applications/Xcode.app app.xcodeproj/ --args -ApplePersistenceIgnoreState YES
This successfully launched Xcode with the standard 'Welcome to Xcode' dialog box you usually get. Hope that helps!
I was able to do it with the following command line in Mavericks:
open -a /Applications/Xcode.app --args -ApplePersistenceIgnoreState YES
Not specific to Xcode:
Please make sure Close windows when quitting an application checkbox is checked under System Preferences > General.
You can stop Xcode from opening the last project by running the following command:
defaults write com.apple.dt.Xcode ApplePersistenceIgnoreState -bool YES
This and other useful commands are here.
Instead of looking for the file that contains Xcode's settings, take a look at the settings themselves using the defaults command:
% defaults read com.apple.xcode | more
I notice two keys that might be relevant: NSRecentXCFileDocuments and NSRecentXCProjectDocuments. Both appear to be arrays, so you could reset one like this:
% defaults write com.apple.xcode NSRecentXCFileDocuments -array ""
Alternately, you could use the defaults read command to dump the settings into a text file, edit that, and then use defaults write to update the settings:
% defaults read com.apple.xcode > xcsettings.plist
// edit xcsettins.plist with your favorite editor
% defaults write com.apple.xcode < xcsettings.plist
Given the project name "MyProject" in directory ~/Documents/Projects/MyProject do the following:
cd ~/Documents/Projects
mv MyProject MyProject.x
open -a Xcode
close MyProject (Option+Command+W)
mv MyProject.x MyProject
open -a Xcode
The this solved the crash for me... however my Storboard was corrupt. Fortunately the Time Machine backup of the folder was intact, I just restored it.
For me it wasn't a project that was causing the crash on startup, it was a particular file (an sks to be exact), so Kay's answer didn't work. When I went to open my particular project, it would still crash.
I simply temporarily deleted the file. Then I opened the project, cleaned, and re-added the file, and all was well.
I think Xcode may update its cache when you quit. It solved my issue to:
close projects
quit Xcode
reopen Xcode.
After installing Xcode 4.0.2, I get this error when I try to launch it by double-clicking on an existing project:
Dyld Error Message:
Library not loaded: #rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation
Referenced from: /Developer/Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Reason: image not found
Launching Xcode via the dock and opening the project from inside Xcode works fine. Also note that doing a repair install of Xcode did not resolve the issue. I haven't tried completely uninstalling Xcode and installing from scratch, but I would prefer to avoid that as I have my IDE nicely customized the way I like it.
Update: I just tried a complete uninstall of Xcode via sudo Developer/Library/uninstall-devtools --mode=all then rebooted and reinstalled. Still having the same issue.
Before you reinstall, make sure your project file is set to open with the expected copy of Xcode 4. Select it in Finder, press Cmd-I, and make sure the Open With... popup is set to the right copy of Xcode 4.
According to the discussion below, the problem is that it is not in the /Developer/Applications/ folder. However, I think that is just a clue to the source of the problem, because Xcode is supposed to work in multiple locations. It is possible that Xcode sets fixed paths when installed and can't be moved. Did you happen to move it after installing?
http://www.iphonedevsdk.com/forum/off-topic/35948-xcode-crash.html
It is the ALIAS that is busted, not Xcode. If you reinstalled Xcode, you should make a new alias for your Dock or Desktop or wherever. Delete the old alias as it is no good any more.
Xcode (should) install in /Developer . You can get to that by going to your hard drive named something like "Macintosh HD". Make a new alias from there.