6

I want to edit three lines of file

enter image description here

Whenever I try to edit it this comes up

enter image description here

I already gave myself permission to Read & Write (I'm 21muffinp)

enter image description here

The same thing still comes up, saying I do not have perimission.

  • 1
    You might need to add the extra permission to the entire path - or drag the file out, change it then put it back [which may ask for admin pw each time] – Tetsujin Apr 5 '15 at 15:42
  • Clarification question? what OSX are you running? OSX or macOS? coz i'm currently using Sierra and neither of the methods mentioned above are working. Thanks! – PhantoMac Feb 4 '17 at 0:28
5

You need read/write permissions to the containing folder as well as the plist itself for Xcode to modify the file in place.

A workaround for this if you are unable to change the permissions of the containing folder is to copy the file out, edit it, then copy it back over the top of the existing file. Alternatively, you can use a different property list editor such as the CLI ‘defaults’.

3

As already mentioned, you will need write permissions for the folder as well as the file. You can't write on a bit of paper that's stored in a room you can only see in to. ;)

Another workaround is to use an editor such as BBEdit (or TextWrangler if you don't need all the features) which will elevate to the correct privileges for you when you attempt to edit the file. Make sure you download the non-App Store versions of these apps, however, otherwise you won't have the option to elevate (because of Apple's sandboxing restrictions for MAS apps)

If you're okay with using Terminal, take a look at using PlistBuddy (which can be accessed at /usr/libexec/PlistBuddy) to edit your .plist files. I prefer it to defaults because it allows you to really drill down in to dicts and arrays when you need to (defaults has an issue with nested keys). Make sure you run it with sudo though otherwise you'll still have permissions problems.

2

Under El Capitan you need to temporarily disable the System Integrity Protection to be able to edit the .plist file.

To do that:

  1. Click the Apple menu.
  2. Select Restart...
  3. Hold down Command + R to boot into Recovery mode.
  4. Click the Utilities menu and select Terminal.
  5. Type csrutil disable and press return.
  6. Close the Terminal app.
  7. Click the Apple menu and select Restart...

You should now be able to modify the file, after you can repeat these steps with csrutil enable to secure your machine again.

1

Try to run Xcode with root privileges:

sudo /Applications/Xcode.app/Contents/MacOS/Xcode

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .