myProject is locked for editing and you may not be able to save your changes?

XcodeFile Permissions

Xcode Problem Overview


I get the following error messages when I moved my code from my laptop to my Mac Mini and opened it over there:

>myProject is locked for editing and you may not be able to save your changes?


>myProject is currently locked because you are not the owner of the file and do not have write permission.


>The file "xxx.xcuserdatad" could not be unlocked. Could not add write permission to the file because you do not own it. Try modifying the permission of the file in the Finder or Terminal.


I did a search with Finder: What came up was a file called UserInterfaceState.xcuserstate inside of xxx.xcuserdatad... GetInfo showed the file not to be locked.

However looking at the path(from GetInfo) showed the file to be within "xxx.xcodeproj" and further within "project.xcworkspace/xcuserdata/xxx.xcuserdatad"

I can't find this anywhere, and I don't know how to use my project on another computer.

Xcode Solutions


Solution 1 - Xcode

Go to the Folder in Finder where the xcode project is and right click -> Get info. The permissions and the bottom should be set to read/write and in my case they were. The trick is to click the settings icon at the bottom and select "Apply to enclosed items". The chmod method shown above doesn't change the permissions of the contents within the folder.

Solution 2 - Xcode

  1. go to the folder in finder
  2. right click on folder and click the "Get info"

enter image description here

  1. go down to the bottom and click the lock and write administrator password

enter image description here

  1. now click on the settings icon and press "Apply to enclosed items..."

enter image description here

Solution 3 - Xcode

Please note that I had to add the recursive command flag and sudo to get it to work for me:

$ sudo chown -R Roger my_app_folder/*

And:

$ sudo chmod -R 774 my_app_folder/*

Because I was getting this error:

> chmod: Unable to change file mode on my_app_folder: Operation not > permitted

Solution 4 - Xcode

Have you tried copying the contents like suggested in this answer?: https://stackoverflow.com/questions/7139780/unable-to-unlock-file-for-editing-in-xcode-4

Alternatively you could use the console to set yourself a writing permission on all the files for your xcode project:

http://www.mac-terminal.com/files-and-folders/permissions/chmod/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionWoofView Question on Stackoverflow
Solution 1 - Xcodeuser2848810View Answer on Stackoverflow
Solution 2 - XcodeRami NourView Answer on Stackoverflow
Solution 3 - Xcodeuser8128167View Answer on Stackoverflow
Solution 4 - XcodePochiView Answer on Stackoverflow