I just updated to Xcode 8 Beta 4 and the shortcut cmd
+ /
to comment a line is not working..
In the dropdown menu it's disabled:
There's a way to activate it again?
I just updated to Xcode 8 Beta 4 and the shortcut cmd
+ /
to comment a line is not working..
In the dropdown menu it's disabled:
There's a way to activate it again?
I fixed it following the steps here: https://twitter.com/kolpanic/status/763323546814844928
In Terminal: sudo /usr/libexec/xpccachectl
Reboot your system.
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.
/Applications
in Finder, and rename Xcode.app
to Xcode2.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 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.
The script mentioned above didn't work right away for me. I had Xcode 8 and 8.1 GM installed and was working with both of them off and on. I ran the script in the terminal, restarted my computer, opened Xcode and it still didn't work. So then I created a new directory in Applications
and moved the GM into that directory. That seemed to fix it.
TL;DR If you have multiple versions of Xcode installed:
sudo /usr/libexec/xpccachectl
Applications
Just update to Xcode8 release, then open Xcode8 and restart Mac.
https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
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:
Go to App Store, check for system update(iTunes, MacOSX). Update all of them.
It should be fixed once its done.
I rebooted, now it is working.
Then when I started beta 4 it asked me to "install required components" a second time. Don't know if related or not.
I applied @junjie 's method
sudo /usr/libexec/xpccachectl
It works well on Xcode 8.2.1 (8C1002) only except for specific files.
Then, I found the reason.
/* Comment ... //*/
This type of comment has made it inoperable.
After the line containing above comment type, "Comment Selection" didn't work.
Erase or change them.
xcode->preferences->key buildings-> filter, search comment
see if there are conflicts for key of "command + / ", if yes, delete others unless "Comment Selection"
enter image description here
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.
Before doing any of less or more complicated steps,
Try to quit and relaunch Xcode.
In my case, it has helped.
xcode->preferences->key buildings
, or,
"command + ,",
then search "comment selection"
change the key "command + /"