I have accidentally added an entry to my defaults database (accessed via /usr/bin/defaults) that is preventing me from installing apps via iTunes.

This is the command to read the offending entry:

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

Which gives the following result:

    BlackList =     (

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

How do I undo / reverse my change?

2 Answers 2


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. Commented Feb 21, 2017 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
    Commented Feb 21, 2017 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. Commented Feb 21, 2017 at 22:29
  • Above, I should say instead of Reading works, say reading still returns the BlackList with com.apple.iTunes entry. Commented Feb 21, 2017 at 23:03

One option is to print out the current array's value (which lists one value per line). Then you can use grep -v '^ "my unwanted key" = ' to filter out the unwanted key, and set the array to that.



/usr/bin/defaults write "$myplist" BlackList \
  "$(/usr/bin/defaults read "$myplist" BlackList \
    | grep -v '^    "com.apple.iTunes" = ')"

You must log in to answer this question.

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