2

I have accidentally added an entry to my defaults (/usr/bin/defaults) that is preventing me from installing apps via iTunes. How do I undo my change?

This is the command to read the offending entry:

/usr/bin/defaults read /Library/Preferences/com.apple.usbmuxd

Which gives the following result:

{
    BlackList =     (
        "com.apple.iTunes"
    );
}

It was added by

/usr/bin/defaults write /Library/Preferences/com.apple.usbmuxd BlackList -array-add com.apple.iTunes

I thought this would remove it, but I can't figure it out.

/usr/bin/defaults delete /Library/Preferences/com.apple.usbmuxd BlackList com.apple.iTunes

This just returns the help for defaults

Here are a few more things I've tried and the results

/usr/bin/defaults delete /Library/Preferences/com.apple.usbmuxd BlackList
Domain (/Library/Preferences/com.apple.usbmuxd) not found.

/usr/bin/defaults delete /Library/Preferences/com.apple.usbmuxd com.apple.iTunes
Domain (/Library/Preferences/com.apple.usbmuxd) not found.

Not sure what the "Domain not found" error is. I tried sudo as well and saw the same error message. Is that not the domain I just added to with the initial write step?

I think this is the command in defaults I want to use:

delete <domain> <key>                deletes key in domain
1

You can delete the BlackList array with

defaults delete /Library/Preferences/com.apple.usbmuxd BlackList
#        delete <domain>                               <key>

Apple doesn't provide an easy way to remove an array element. You can either set the BlackList array with -array with the item excluded, or edit the file manually using Xcode for example.

  • Looks right to me, the same thing I tried above, although I still get the same error of not finding the domain. – SwimBikeRun Feb 21 '17 at 22:24
  • @Swim Domain not found means that file /Library/Preferences/com.apple.usbmuxd.plist can't be found. Does the file exist? Does using defaults read on that file still work? Did you do defaults delete /Library/Preferences/com.apple.usbmuxd without anything else on the end at some point? – grg Feb 21 '17 at 22:26
  • Reading still works. I looked at the file in xcode like you suggested (good suggestion! I'm new to mac and didn't realize that was possible.) -- When trying to edit in xcode, I get a permission error. I did a sudo chmod 777, but it still had a permission error when trying to delete the entry in xcode. – SwimBikeRun Feb 21 '17 at 22:29
  • Above, I should say instead of Reading works, say reading still returns the BlackList with com.apple.iTunes entry. – SwimBikeRun Feb 21 '17 at 23:03

You must log in to answer this question.

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