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

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

Related

Not able to copy and install android studio on mac

I have downloaded android stdio setup from android developer site i.e. https://developer.android.com/studio/?hl=ja#downloads of version 3.1.2.
When I started the installation, it ask for copy android stdio to "Application" folder. when I do that mac give error like
"The operation can’t be completed because you don’t have permission to access some of the items."
Please let know how to install.
I also faced similar issue.
Solution:-
Drag it to Desktop. Then move it to Applications folder. and it will work fine.
Best of luck
I tried the above solution and it did not work. I got it to work by accident. The last action i did was:
Drag the .dmg into the Applications folder, and back into Downloads
Drag the Android Studio icon into Applications and it worked.
I had similar issues.
First, repair disk permissions with Disk Utility, for both volumes!
If that doesn't fix the problem, then right-click (or control-option-left click) on the folders. Then select Get Info, and then check the Sharing & Permissions for them. There you want to see Read & Write, in case you see Read Only, then change it!
Source: https://discussions.apple.com/thread/3002619
Problem:
Had the same issue with the installer getting to 528MB and then the same error as in your screenshot:
"The operation can't be completed because you don't have permission to access some of the items."
Solution:
I was installing version 3.1.4 so change the below so that the paths are correct:
sudo rsync -rvzPKh /Volumes/Android\ Studio\ 3.1.4/Android\ Studio.app /Applications/
That will copy all the files into place, but you will still get an error related to a missing dylib if you try launch via terminal.
For some reason there is a symlink that does not get copied over so we have to patch that:
cd /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/MacOS
sudo ln -s ../Home/jre/lib/jli/libjli.dylib libjli.dylib
Now just launch the app from Applications as you usually would. That should get you moving.
Also:
Personally, I've been having other issues with my other intellij platforms like PyCharm and WebStorm that give me an error intermittently when I try to launch them. Namely a popup containing:
Start Failed: Internal error. Please report to https://code.google.com/p/android/issues
java.lang.ClassNotFoundException: com.intellij.ide.plugins.PluginManager
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:227)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:36)
at com.intellij.idea.Main.main(Main.java:83)
However since I feel this issue is specific to me I think it might work for some of you out there. Would be interested to know if this works for anyone, please let me know in the comments.
I have the same problem yesterday and here's how I solve it today.
open the terminal.app
enter "sudo spctl --master-disable" and enter the password
System Preferences -> Security & Privacy -> Allow apps downloaded from: -> select "Anywhere"
install again, and it will be fine.

XCode 7.3.1 Update Not Installing

It looks like XCode came out with a new update. This issue seems to be persistent where the iTunes Store does not render the update even though it posts it in the "Updates Installed in Last 30 Days" section. After I restart, I am then prompted to update again even though I have already done it twice. Ultimately, the update does not apply when I open XCode (it still shows 7.3, not 7.3.1):
There is only one way! For this you need:
1. Delete the XCode 7.3 from Applications folder
2. Download the Xcode 7.3.1 from here
3. install it manually
That's it))
A possible method of resolving this issue which has worked for people including myself, is as follows:
Close App Store.
Using terminal type the following:
open $TMPDIR/../C
Locate and then delete the folder named com.apple.appstore
Empty Trash folder, if you get an error message saying that files are in use try the following:
sudo rm -rf ~/.Trash/*
Restart Mac.
Once you have restarted your Mac try to install the update.
If this does not work delete Xcode from /Applications and repeat the above method.

Xcode won't start, stuck on 'Verifying "Xcode"...'

I've installed Xcode on a mac and when I try to start it I get a little window open saying 'Verifying Xcode' with a status bar scrolling across, anyone got a fix rather than reinstalling?
If you don't want to wait forever, this might help:
xattr -d com.apple.quarantine '/Applications/Xcode.app'
Running a command to get through Gatekeeper sounds like the way to go, since you downloaded it from a trusted source. This is a common occurrence when installing large bundles in Mac OS X. Basically, Gatekeeper examines your entire bundle, making sure that there is no suspicious code. This is one of the many things that keeps Mac OS X as secure as it is. You have two options:
1: Give it time.
Or,
2: Manually tell Gatekeeper "It's okay, this is from a trusted source". How do we do this? Well, first fire up the Terminal and navigate to your Xcode.app folder. (Or type in cd and drag-and-drop Xcode from your applications folder), then hit enter.
Next, run the command:
xattr -d com.apple.quarantine Xcode.app
Now, be careful getting past Gatekeeper if whatever you are installing is even slightly from an untrusted source, or else you introduce a security risk to your computer. In my case, opening new versions of Xcode quickly is the only time I will ever run that command.
anyone got a fix rather than me reinstalling?
For anyone else seeing a very long "Verifying Xcode" phase, just give it time. The indeterminate progress bar stays up there for a long time (tens of minutes) while Gatekeeper looks at the (very large) Xcode bundle to make sure that it's legit. Eventually, you'll get the familiar message along the lines of "This application was downloaded from the Internet. Do you want to continue?" Or, if the bundle doesn't check out, you'll of course get a message to that effect.
Almost every answer here recommends running xattr -d on the file. This deletes the file's extended attributes (like com.apple.quarantine) so OSX will not run the verification phase. You should only do this as an absolute last resort if at all. Apple explicitly recommends leaving Gatekeeper enabled to validate your version of Xcode after XcodeGhost malware was spread to popular iOS apps via infected versions of Xcode.
If you're stuck trying unarchive an Xcode beta .xip archive, try this:
Open the Archive Utility app. (Open Finder by hitting ⌘+spacebar and type "Archive Utility")
Choose File->Expand Archive and select the Xcode archive.
I had same issue. Quick fix is to open terminal from application or type terminal in spotlight and enter below command.
cd /Applications - This will move to applications directory where Xcode is present
xattr -d com.apple.quarantine Xcode.app - This will bypass Gatekeeper in OS X and will launch Xcode quickly
Note: If you have changed name of Xcode (say Xcode7-1) then you should enter ... Xcode7-1.app command. Refer screenshot
open terminal -
1.Type cd drag drop your xcode (for path) then enter
2.next xattr -d com.apple.quarantine Xcode.app enter
agree for terms and condition
For Xcode 8:
To skip the verifying process on El Capitan for Xcode 8, download Xcode 8 at the developer downloads page, then open terminal.
Following this, type
xattr -d com.apple.quarantine
Then drag your xcode 8 download into your terminal window.
It should look like this:
A lot of talk here about exempting Xcode-beta.app from Gatekeeper, but for me, I had to make the .xip file exempt.
I placed Xcode_8_beta_6.xip into /Applications, then in Terminal, changed directory to /Applications and ran:
xattr -d com.apple.quarantine Xcode_8_beta_6.xip
Then double clicked the .xip to get it to unpack.
running xattr -d com.apple.quarantine Xcode.app worked like a charm. Waiting on the "verifying xcode" didn't work, as it never completed.
Also you can remove Open Warning for entire directory Applications via the command in the terminal:
xattr -d -r com.apple.quarantine ~/Applications
it's work for me:
open Terminal cd to path Xcode.app
xattr -d com.apple.quarantine Xcode.app
You can try the command:
xattr -r -d com.apple.quarantine /your_path_to_xcode/Xcode.app
If you do not use -r, you will have to run the same command for the iOS simulator later on. I am not sure what other executables are hidden in this bundle and are quarantined.
If you have time, the recommended method is to leave the verification to complete so that everything is verified properly.
I had the same issue (Macbook Pro, Mid 2015, OS X 10.11.15) and was able to fix it without using the terminal to bypass Gatekeeper:
Trash all previously downloaded versions of the file and empty the trash. (If you haven't emptied your trash in forever this may take a long time. You can selectively delete the offending .xip files manually to save time.) I found multiple instances that would not delete because they were currently in use.
Restart your computer. Now you should be able to delete any .xip files in the trash without issue.
Download the Xcode8 beta again (don't stream media while doing this to save on time and packet loss.) and open it.
If this doesn't do the trick, open up terminal and follow one of the answers above.
Run the following command making sure this is your Xcode's location on the system & replace the xcode name with actual name which code be xcode2 or Xcode 3 incase if you have more versions of Xcode on your machine..
All the best ..
xattr -d com.apple.quarantine Xcode.app
Just wait for process to get over with.. sometimes it takes longer than the usual time but ends up showing the alert boxes for next process! sit back let it finish. :)
If you are not logged in to Xcode try logging in with any Apple account.

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

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

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