Due to some reason some of files were locked in xcode, which i resolved through the this solution.
but even after that i keep getting this error
****The file “project.pbxproj” 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 also tried unlocking it through above method and it is not working, also i'm not even able to close the project and when i force close it, next time all the previous changes are gone.
This means that the project was created by a different user. Log as that user, or if you cannot, create a "test.txt" file next to the file you can't unlock.
Open Terminal, go to the folder where the project resides, and run a command such as
You should see a list such as:
Now, the "-rw-r--r--" is the permission. You just created test.txt, so those are the correct permissions from the GUI. r counts for 4, w counts for 2, x counts for one; rw-r--r-- is therefore 6,4,4. In the example, project.pbxproj is 6,6,4.
So the two commands you need are
If you are in the project directory and are absolutely, utterly, deadly sure that nothing there or in its subdirectories should belong to anyone but you, then you can mass-change ownership of the directory, its subdirectories and all they contain:
If you do the above in the wrong directory (not yours, not a project directory, etc.), the -R (recursive) flag is a recipe for disaster, so be careful.
Just in case, remember that directories must have all x's set, so what is 644 for a file would become 755 for a directory.
When finished, you can delete the example file 'test.txt' - actually you can do that as soon as you have written down what the correct ownership and permissions should be.