XCode 4.2: Organizer documentation is locked in a OSX Lion way - xcode

I'm using the XCode 4.2 beta (build 4D199) on Lion, and can't access the Developer Documentation in XCode 4.2 anymore. When I attempt to log-in, I get a pop-up telling me the (remote) file is "locked", in the fashion that Lion does these things.
Does anybody have a suggestion what I can do to access the documentation from within the Organizer?
I used to be able to access it without any issues, not sure what changed.

The situation was fixed for me by Apple / XCode itself, as it automatically downloaded the (newly available?) "iOS 5.0 Library" documentation files. Documentation now runs from a complete local copy.
To be sure you get this too you need to have the automatic download of documentation files turned on.
Preferences > Downloads > Documentation > Check for and install updates automatically
(You can also download the files manually by clicking on "Check and install now")

Same here.
To work around this issue, right click on the sign in page and choose "Open Page in Browser". This will open the same resource in Safari.

1.- Download library from: http://developer.apple.com/rss/com.apple.adc.documentation.AppleiPhone5_0.atom
2.- Open with The Unarchiver
3.- Copy file in "Developer/Documentation/DocSets
4.- Open Xcode

Had the same problem. To solve it (well seems like that), i went in
Xcode -> Preferences -> Downloads -> Documentation
Download the parts you need, for me it worked.

As other commenters have stated you should be able to fix these problems by downloading the documentation again. However, given that a complete set of iOS & MacOS documentation clocks in at around 2.0GB here is an alternative method that avoids re-downloading.
Jump to the documentation folder:
cd /Library/Developer/Shared/Documentation/DocSets
Recurse through all the documentation sets and set the current user as the owner:
for f in *.docset; do sudo chown -R $USER $f; done
Unlock the documentation sets:
for f in *.docset; do SetFile -a l $f; done
N.B. Your documentation path may be different (check ~/Library/...), you should make sure that $USER is correctly set to your username, you will need the root password

Related

“qmake” cannot be opened because the developer cannot be verified

I'm trying to install the omnetpp simulator abut I was not able to use its graphic interface. To run it properly I have to install Qt5 which I did through homebrew. My Qt version is 5.15.0 and my MacOS is Catalina (10.15.5 (19F101)).
When running the ./configure command to install omnetpp, I got the following error:
“qmake” cannot be opened because the developer cannot be verified.
In summary I had problems with the omnetpp when trying to run the graphic interface Qt, then I've installed Qt5 and now I get an error telling me that qmake cannot be verified.
Thanks,
The problem is that this will come many times... It has something to do with the new security settings for MacOS Catalina.
I found another work-around, which worked very well for me. Go to Systems Preferences -> Security and Privacy -> Privacy. Scroll down the left menu to Developer Tools and allow Terminal to run software locally (tick the box).
I was able to circumvent this problem by opening System Preferences, Security & Privacy, General, and then allowing the file to be executed. When I ran make again the Qmake command ran without any warnings or windows popping up.
According to Apple's website, you need to find qmake in the Finder, CTRL+click on it and press "Open". After that, qmake will be marked as an authorized app and you can run ./configure again.
I am a Windows user and could find the official Apple support page (https://support.apple.com/de-de/guide/mac-help/mh40616/mac) within a minute of googling, by the way.
You can run the following command to "un-quarantine" your binary (assuming its path is /usr/bin/qmake):
xattr -w com.apple.quarantine "00c1;$(xattr -p com.apple.quarantine /usr/bin/qmake | cut -d";" -f2-4)" /usr/bin/qmake

"Add Documentation" is disabled in Xcode 9.1 (9B55)

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.

Can't find glew.h in Xcode 5.0

I updated to Xcode 5.0 and I can't seem to be able to include the GL/glew.h file. In previous Xcode version one had to set the base SDK to current OSX, but that option is no longer available (at least I can't find).
The file glew.h is in /usr/include/GL and I already set the header search paths to /usr/include, but it still doesn't work.
Can anyone help?
Thank you
Got it to work.
Find in the Project Build Settings > Search Paths > Always Search User Paths and set it to yes.
Also, I couldn't link with libGLEW so I had to go into the XCode.app and create a symbolic link to the the file.
Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib
It is definitely not a great solution but is a work-around for me.
Edit:
Here, I suppose that one is working with the Mac OSX 10.8 SKD. For other SDKS, the path should be another one.
In the terminal I created a link to my libGLEW.dylib (which was in /usr/lib) in this way
cd Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib
sudo ln -s /usr/lib/libGLEW.dylib libGLEW.dylib
Afterwards, back in XCode, in my project's "Build Settings" I set "Other Linker Flags" to -lGLEW

Unable to view Xcode 4.2 help “index.html” is locked for editing

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

How to Get Xcode to Not Automatically Open Previously Opened Projects

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.

Resources