I just upgraded to Xcode GM 8.0 and noticed ⌘ + / is not commenting out selected lines. Is there another command to comment out multiple lines in Xcode 8?
-
It works for me. Do you see any conflicts in Preferences -> Key Bindings -> Conflicts? – sbooth Sep 15 '16 at 19:49
-
I had 8 Command Conflicts none were ⌘ + /. I removed them anyway then restarted and relaunched Xcode. Still the command is not working, just get an error chime when pressed. I do see the Command in KeyBindings window under Comment Selection for the various editors. Not sure whats going on. – DaveLass Sep 15 '16 at 20:09
-
I am encountering this issue too with the public release of Xcode 8. I also have the same 8 conflicts and none of them is the command for line comment like what @DaveLass mentioned – jaytrixz Sep 16 '16 at 13:34
5 Answers
In Xcode7 and earlier versions, the commenting option was available in Editor > Structure > Comment Selection. In Xcode 8 this option is disabled.
To enable these options run sudo /usr/libexec/xpccachectl
and restart your Mac.
There is thread on Apple Developer Forums regarding this issue and several possible fixes. For me running the above command and restarting the Mac did the fix.
Also in Xcode 8 release note it states:
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)

- 586
- 5
- 15
-
1This worked at first for Xcode 8. But then I ran the 8.1 beta and it's stopped working again for 8! And now it won't work at all, even after re-running xpccachectl and restarting the Mac. What the...? As @jwhat said, this is just ridiculous. – norders Nov 02 '16 at 11:30
-
2
-
1this does not work for me . when i fire this command system give me error sudo: usr/libexec/xpccachectl: command not found – Himanshu Moradiya Mar 22 '17 at 11:19
-
Have you installed xCode additional components @HimanshuMoradiya? If not, try this http://stackoverflow.com/a/23026952/2559325 – amiladiman Mar 22 '17 at 11:56
-
@bob You might need to have a look at fr0sky's answer below to solve your problem if you're still having this issue. – Julien Spronck Mar 24 '17 at 16:37
-
This works for me in Xcode 8.3. The only thing I noticed is when I installed a recent Xcode update, multi-line comments stopped working and I had to run this again – Lance Samaria Apr 07 '17 at 11:52
-
May 16, 2017 and we're still dealing with this. Thank you for the working answer. – pizzafilms May 17 '17 at 00:03
-
This is a consistent issue for me and this ALWAYS solves the issue! – Lance Samaria Sep 20 '17 at 23:39
I finally figured this one out, drove me crazy…
These are the preconditions for the bug to arise:
- '/' needs to be accessed with the shift key, like i.e. on German keyboards.
- There is a global OS X hotkey to access help with shift+cmd+'/', which is the default
Under these preconditions there is not conflict showing in XCode keyboard preferences, but it trying to invoke cmd+'/' triggers the global help hotkey anyway.
How to fix it?
Simply remap or switch off the global hotkey to show help in system preferences > keyboard > keyboard shortcuts, select app shortcuts in the list on the left.

- 159
- 1
- 3
Go to Systems Preferences > Keyboard > Shortcuts > App shortcuts and disable Show Help menu option.
That worked for me after try with all possible solutions.
-
This fixed the problem for me. It's probably more related to a macOS update than to a Xcode. – Ruben Marin Aug 03 '17 at 11:50
-
Sometimes this happens to me (even with Xcode7, and just confirmed still with Xcode8) after opening the documentation window (Help -> Documentation and API Reference or cmd+shift+0). Here are a few things that have fixed it when it was happening to me:
- Restart Xcode (realize you've already tried this, but including it for posterity)
- Close the documentation window
- With only 1 Xcode window open, hit cmd+~ a couple times
- Wish really really hard

- 1,597
- 11
- 18