Xcode 8 Beta 4 - Comment Shortcut Disabled - xcode8

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.
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.

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:
Run in terminal: sudo /usr/libexec/xpccachectl
Restart your computer
Create a new directory in Applications
Move the other version into that directory
Restart Xcode and enjoy!

As explained there, here's a solution that doesn't require a reboot:
Close Xcode
In the Application folder, rename Xcode.app (or similar) to Xcode2.app. You might need to type in your password.
Open Xcode, then close it.
Rename Xcode2.app back to what it was before.
(Optional) Spend 5 minutes wondering why this worked.

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)

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 + /"

Related

Model is running iOS 10.2 (14C92), which may not be supported by this version of Xcode

I am facing this error, i am done with research on that.
I conclude the result, i need one file for device support 10.2(14C92)
Please share that file.
GoTo:
Right click on Xcode 8 or Newer version of your Xcode, select "Show
Package Contents", "Contents", "Developer", "Platforms",
"iPhoneOS.Platform", "Device Support"
Copy the 10.2(14C92) folder (or above for later version).
I need that folder.
Thanks.
If somebody facing similar issue with Xcode 9.1
Open directory:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Create new folder "11.2 (15C107)" (or "10.3 (14E269)" for older versions, depends on what exactly are you missing)
Paste files from provided google drive folder
11.2 (15C107)
(or 10.3 (14E269) if you need older files)
Restart Xcode
For other iOS versions you may check #Sour LeangChhean 's answer
Keep in mind, that some day you will need to upgrade your Xcode anyway :)
I had the exactly same problem.
Just upgraded to xcode version 8.2.1 ( 8C1002 ) and the problem was solved.
Here I have this file for 10.3 or 11.3 or 11.4 into Xcode 8+.
You can download file from this link.
10.3:-
https://www.dropbox.com/s/i1f7q8w3vgr2ozl/10.3%20%2814E269%29.zip?dl=0
11.3:-
https://www.dropbox.com/s/wya3eu2j5db7tpt/11.3%20%2815E217%29.zip?dl=0
11.4:-
https://www.dropbox.com/s/86i9zjunpsy9b0b/11.4%20%2815F79%29.zip?dl=0
9 -> 12 All Files:
https://github.com/mendaparadarshit/xcode-9-ios-12-support
Steps:-
Download above Zip file and extract them.
Click on "Finder" in MAC OS, You can see in Topbar all menus, Click on "Go"
Click on "Go to Folder" ()
Paste this path over their (make sure that you have installed xcode with named : "Xcode.app")
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Paste your extracted "10.3 (14E269)" directory to that place.
quite Xcode and restart it. you can run your projects successfully in your real device.
Thank you,
Darshit
Here I have this file for 12.1 or 12.0 or 11.3 or 11.4 into Xcode 8+ or XCode 9+. You can download file from this link. 10.3:- https://www.dropbox.com/s/i1f7q8w3vgr2ozl/10.3%20%2814E269%29.zip?dl=0
11.3:- https://www.dropbox.com/s/wya3eu2j5db7tpt/11.3%20%2815E217%29.zip?dl=0
11.4:- https://www.dropbox.com/s/86i9zjunpsy9b0b/11.4%20%2815F79%29.zip?dl=0
12.0 & 12.1:- https://github.com/Yatko/iOS-device-support-files
Steps:-
Download above Zip file and extract them.
Click on "Finder" in MAC OS
Click on "Go to Folder"
Paste this path over their (make sure that you have installed xcode with named : "Xcode.app") /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Paste your extracted "10.3 (14E269)" directory to that place.
quite Xcode and restart it. you can run your projects successfully in your real device.
If you download the latest version after 12.1 then please upload that file and update the answer.
I downloaded the appropriate zip file from https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport for my devices version of iOS
Unzipped the contained folder to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
And finally restarted Xcode. No need to update Xcode it's self
Here is steps to build on device with iOS 10.3 and Xcode 8.2.1:
Open next directory: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Create new folder "10.3 (14E277)"
Copy files: DeveloperDiskImage.dmg, DeveloperDiskImage.dmg.signature FROM 10.2 (14C89) folder TO new 10.3 (14E277)
Restart Xcode
I solved the problem by updating Xcode.
However, for some strange reason the update was NOT shown in App Store under the Updates section. I had to manually search App Store for Xcode and select GET, then INSTALL. It installed a newer version, and problem was solved.
Not sure why Apple does this to developers ...
I have this problem, and I solved this by downloading the latest Xcode version.
you need update your xCode to the last current version.
Each version have the last iOS version included.
Try register your device in the provisioning profile using its UDID.

XCode hangs every time when i write few lines of code in playground

I have just started working with Swish after buying my new imac and i am working on play ground. for last 2 days i am banging my head with wall but i could not fix this problem.
When ever i am writing few lines of code, Xcode hangs and mouse turns into small colored circle when you hoverover on the xcode window. I have to quit by force every time when xcode hangs.
I tried all possible option which i could find on stackoverflow;
I draged xcode from application to trash bin, cleaned trash bin, restarted the imac, downloaded xcode from app store installed it.
when i opened xcode after installation, it opened all my files automatically and problem was still there.
Then i followed this solution How to uninstall Xcode 5.0.2 from MAC 10.9 and removed all xcode related files by using appCleaner. It cleaned all files and folder. I restarted my system and installed xcode again :( and problem is still there.
I tried to uninstall xcode with sudo /Developer/Library/uninstall-devtools --mode=all but it does not work, terminal says
sudo: /Developer/Library/uninstall-devtools: command not found
I could see that there is something wrong with this run time compiler.
and yes i downloaded and installed the xcode 6.4 beta version and problem still there.
Can any one turn my face from :( -> :)
Here is a solution which #user3344236 provids. If someone has same problem use this trick. Create an empty project and then add playgrounds file in it. It would not crash or Xcode would not hang.
Playground is in early stages and there is something fishy with "standalone" playground, If you create swift file with File->New->PlayGround, there is high chances that Xcode will hang and you can have same problem what i had for 2 days.
A little late, but I have run into similar problems with the latest XCode (7.2) on Yoesmite. This is espcially annoying when you are, for example, writing up a long tutorial in the editor and risk losing content because of a Force Quit situation.
The simplest workaround I have found, especially when I am initially entering all the text and code (and hence really don't want it continuously trying to execute) is to insert the following at the top of each new file - removing it when I am ready to autorun the code.
don't execute
It can be any text, as long as it doesn't parse. The playground environment won't try to run while there is a syntax error in the file. But you still get all the context-sensitive help and auto-completion magic to aid in your writing.

UIKit.h not found error

I made a single view app for the ipad, with a movie, webview and button, and I get this error when I try and run it. I have restarted the application, and reinstalled it, but nothing is working. This error keeps coming up in my MoviePlayer_Prefix.pch file. Can someone help me out?
I have had the same issue with being unable to compile project due to UIKit.h not being found + "unable to load standard library for target..."
The solution for me was very simple - to quit (CMD+Q) and relaunch Xcode. I have found out that with Xcode opened, macOS seems to have removed command line tools for Xcode because it was preparing for a update and relaunching Xcode triggered the "install additional components" update and it made the problem disappear.
Like Faul Textor said, most likely your XCode updated to 12.1 but your Command Line Tools didn't. You need to quit XCode completely and then start it again and you should get a pop-up saying "Install Additional Components"
Sorry, this should have been a comment to his reply but I cannot do that.
It sounds like you removed the UIKit.framework from your project at some point. Check if it is listed in your project navigator. If it's not there, go to your project in the project navigator pane, select your target, go to the build phases tab, click on link binary with libraries, hit the plus button, find the UIKit.framework there and add it to your project.
EDIT:
This answer suggests that there mayb be an issue with your framework search paths build setting. Check that out and if the path is empty and it still doesn't work, a re-install of Xcode would fix it, I think.
Just wanted to add my two cents on not making a dumb-ass mistake - came across this answer hoping to solve same problem.
Turns out I had written #import "<UIKit/UIKit.h>" instead of #import <UIKit/UIKit.h>.
Thought I would add in case someone else makes a simple mistake like me.

Xcode Internal error and no project opens

Im on 10.6 and using xcode 3.2.6. On xcode launch (however i launch) i get an xcode "internal error' popup telling me:
File: /SourceCache/DevToolsBase/DevToolsBase-1809/XcodeFoundation/Specifications/XCSpecification.m
Line: 448
Object:
Method: registerSpecificationProxiesFromPropertyListsInDirectory:recursively:inDomain:inBundle:
path should be a string, but it is nil
I can 'quit' or 'continue'. Continue launches xcode. The problem is that once open if i double click an .xcodeproj - nothing happens within xcode. To open a project I have to manually go file->open and navigate to the file.
Google gives a couple of similar issues - including this one
http://lists.apple.com/archives/mac-games-dev/2011/Mar/threads.html#00001
And i've tried everything i can think of with no joy, (Including down grading to the xcode on the OS DVD).
It looks like it can be an issue with whatever particular version of Xcode that you have running. It might be a good idea to get the latest and greatest to see if it's an issue with the Xcode software itself.
I was just hitting this and fixed it by removing a dead symlink at:
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
This thread tipped me off (although it wasn't Airplay in my case).

XCode 4 Archive/IPA Error: "The operation couldn’t be completed. No such file or directory"

I've found various proposed solutions to this problem on this internet, but none of them work for me. Does anyone know why this might be happening?
http://answers.unity3d.com/questions/15294/xcode-build-and-archive-error-no-such-file-or-directory
http://blog.joshschumacher.com/2011/04/06/xcode4-the-operation-couldn%E2%80%99t-be-completed-no-such-file-or-directory/
I've tried archiving with every combination of coding signing vs not using code signing, and I've tried using every combination of provisioning profiles, but I still get the same error every time.
I'm very confused as to why I'd even be getting an error like this when trying to save a file. I'm using XCode 4, my application builds for archive fine. In fact, I can even upload my application to itunesconnect (and it was accepted!). I just can't create an IPA for sharing and beta testing before submission.
Any ideas?
The error message
Right before I get the error
After much frustration, I filed a developer support request with Apple. The technician I spoke with was able to save my archive as an .ipa on her computer -- the exact same archive that I was not able to save on mine, which pointed to a possible bug in my system (and from the sounds of it, many other people's).
She recommended that I uninstall and reinstall XCode and the developer tools, and that worked!
Here were her uninstall instructions:
Make sure that your machine is running the latest Mac OS X (10.6.7) and iTunes.
Run the following command in the Terminal application to uninstall your SKD:
sudo <Xcode>/Library/uninstall-devtools --mode=all (where <Xcode> is the path to the directory that contains your SDK.)
Drag your <Xcode> to the trash and restart your machine
Re-download and install Xcode (4.0.2) from the iOS Dev Center. Make sure that the System Tools, UNIX Development, Essentials packages in the Custom Install pane are selected before installing it.
I have the same issue after my distribution certificate was expired. I add new ones (private key and certificate) and xCode "Share" command starts to produce such error.
The problem resolves as soon as I remove old private key & certificate from Keychain Access.
Hope it helps
Selecting "Don't Re-sign" at Identity solved the same issue for me.
I actually had the same problem, but a different solution (and reason). I had Xcode 3 and Xcode 4 both running at one point. I recently deleted Xcode 3 and moved my Xcode 4 from /Xcode4 to /Developer directory. This caused me to have the same issue you describe.
I moved the directory back to /Xcode4 and now my archives save out correctly.
I also had the same problem but I could resolve the problem in the below way.
My project was on the portable disk (formatted as FAT-32) and the project referred some folders on the same disk as "add folder reference for any added folder". I could build it any configurations however I couldn't just make .ipa file with above alert.
So, I copied the referenced folders on the portable disk to the desktop of the disk installed XCode (MacOS). And adding again the folders into the project. I could make .ipa file.
I installed Xcode 4.0.2 in one directory and then manually moved it to another.
When I moved Xcode back to the first directory everything worked.