If Cmd-/ still doesn't work in Xcode 8 on an OS X 10.11 (and apparently on a macOS Sierra - thanks to @DanBlakemore), and sudo /usr/libexec/xpccachectl and a reboot didn't help, try the following.
Close Xcode.
Open /Applications in Finder, and rename Xcode.app to Xcode2.app (or any other name).
Rename it back to Xcode.app, and relaunch.
It should work now.
The problem seems to be that for whatever reason the system "uninstalls" Xcode extensions at some point, and won't "install" them again. This can be checked by opening Console, and grepping for INSTALL. If you have INSTALLED/UNINSTALLED for com.apple.dt.XcodeBuiltInExtensions, it won't work if UNINSTALLED was the last action on it, and will work it if was INSTALLED.
Figured this out when debugging an Xcode 8 extension.
To use the Editor's Comment/Uncomment Selection and Add Documentation commands—as well as other installed Xcode Extensions—on OS X version 10.11, launch Xcode and install additional system components, then restart your Mac. (26106213)
As explained there, here's a solution that doesn't require a reboot:
This made it for me:
Goto System Preferences -> Keyboard -> Shortcuts -> App Shortcuts
Add a new shortcut like this:
Voila! It works for me!
As you can see the shortcut you choose will also end up besides this command in Editor menu in Xcode.
If
Cmd-/
still doesn't work in Xcode 8 on an OS X 10.11 (and apparently on a macOS Sierra - thanks to @DanBlakemore), andsudo /usr/libexec/xpccachectl
and a reboot didn't help, try the following./Applications
in Finder, and renameXcode.app
toXcode2.app
(or any other name).Xcode.app
, and relaunch.It should work now.
The problem seems to be that for whatever reason the system "uninstalls" Xcode extensions at some point, and won't "install" them again. This can be checked by opening Console, and grepping for
INSTALL
. If you haveINSTALLED
/UNINSTALLED
forcom.apple.dt.XcodeBuiltInExtensions
, it won't work ifUNINSTALLED
was the last action on it, and will work it if wasINSTALLED
.Figured this out when debugging an Xcode 8 extension.
Go to App Store, check for system update(iTunes, MacOSX). Update all of them.
It should be fixed once its done.
Just update to Xcode8 release, then open Xcode8 and restart Mac.
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
I fixed it following the steps here: https://twitter.com/kolpanic/status/763323546814844928
In Terminal:
sudo /usr/libexec/xpccachectl
Reboot your system.