8

This answer explains how to uninstall iTunes after disabling SIP. This appears to be a necessary step for uninstalling iTunes on versions of OSX starting with 10.13 High Sierra or earlier.

I'd prefer not to disable SIP, since the only reason I have to do so is to prevent iTunes from launching in response to various unknown stimuli.

Is there a way to prevent iTunes from starting up without needing to disable SIP? I just want to prevent it from start up, I don't need to uninstall it. Most importantly I want to stop it from occasionally commencing to play music for no apparent reason, but ideally I would like to prevent it from running altogether. Is there some way I can disable it as the handler for some file type, for example?

3
  • 1
    Not an answer to your question exactly, but IMO If it's just a one time thing, you could just disable it, remove iTunes and then enable it again. Commented Mar 6, 2019 at 19:35
  • 1
    can't you just do sudo chmod -x /path/to/itunes.bin ? (idk what the MacOS version of sudo is, but su root )
    – hanshenrik
    Commented Mar 6, 2019 at 20:43
  • @hanshenrik The Mac version of sudo is just sudo. (: Also, it'll be /Applications/iTunes.app/Contents/MacOS/iTunes. ...I should probably post this as an answer.
    – SilverWolf
    Commented Mar 7, 2019 at 1:03

2 Answers 2

4

boot up the system in "macOS Recovery HD" where SIP restrictions are not enforced (according to @user3439894 ) , and basically run in a terminal

sudo find '/Volumes/Macintosh HD/Applications/iTunes.app' -depth -print0 | sudo xargs -0 chmod a-x

and reboot into mac. it basically recursively remove the executable flag on every file in /Applications/iTunes.app , which should stop MacOS from ever starting iTunes (the normal way), which effectively makes iTunes disabled.

boot up the system in an Ubuntu CD/usb drive, and basically run in a terminal

sudo su
mkdir /mount
mount /dev/nvme0n1p1 /mount
find /mount/Applications/iTunes.app/ -depth -print0 | xargs -0 chmod a-x

and reboot into mac. it basically recursively remove the executable flag on every file in /Applications/iTunes.app , which should stop MacOS from ever starting iTunes (the normal way), which effectively makes iTunes disabled.

  • you have to change /dev/nvme0n1p1 with wherever the root partition is, and if you don't know, you can launch gparted with the command sudo gparted which can help you find out by matching the size of your MacOS root partition with every partition in the system. but if you're using an NVMe disk, it's probably /dev/nvme0n1p1

    • this probably won't work if your MacOS partition is encrypted..
6
  • 3
    You do not need to boot an Ubuntu CD/usb drive. The system can be booted to the macOS Recovery HD where SIP restrictions are not enforced on the e.g. Macintosh HD volume because it's not the Startup Disk at that point, and make changes directly from macOS. While the OP doesn't want to disable SIP, he may also not want to have to boot to the Recovery HD to do this either. Commented Mar 6, 2019 at 21:27
  • 1
    @user3439894 that sounds like an even better idea indeed
    – hanshenrik
    Commented Mar 6, 2019 at 21:29
  • 2
    iTunes is not in /Applications when booted to the macOS Recovery HD, it's in e.g.: /Volumes/Macintosh HD/Applications Commented Mar 6, 2019 at 21:41
  • 1
    Just an FYI... One has to boot the the macOS Recovery HD in order to disable SIP to then boot back to normal mode, with e.g. Macintosh HD as the Startup Disk, to then do the same things that can be done in Terminal from macOS Recovery HD without disabling SIP. In other words, things that require SIP being disabled when done in normal mode do not require SIP to be disabled when done from macOS Recovery HD in Terminal. Commented Mar 6, 2019 at 21:54
  • 1
    xargs isn't available in the recovery shell, so instead I did find . -type f | while read f; do chmod a-x "$f"; done from the iTunes installation directory. Took about a minute to run on the 6000+ files in there.
    – intuited
    Commented Apr 24, 2020 at 14:40
8

I wasn't able to find a list of all the file types iTunes handles, but if you are willing to operate piecemeal, any time you open a file and iTunes launches, you can

  1. Select the file in Finder

  2. Get Info ( + i)

  3. select the app you want to use in the "Open With:" dropdown

    Open with portion of the get info dialog

  4. then click "Change All..."

In the future that type of file will open in your alternate application. After a while you will have opened all the types of files you will open that iTunes handles.

Another method that you may find easier:

  1. Right Click (or control click) the offending file in Finder

  2. Select "Open With > Other..." (even if you see the app you want to use in the list)

Open With > Other... selected

  1. Select your App (e.g. Audacity)

  2. Check "Always Open With" Always Open With!

  3. Click "Open"

It just depends on which way you find easier.

2
  • 2
    Currently, the visual instructions would lead me to have iTunes selected and then click Change_All, accomplishing nothing. Perhaps a 2nd pic with an alternative selected app could make this visually clearer? Commented Mar 6, 2019 at 18:15
  • This solution doesn't work for me because iTunes doesn't open in response to me opening files—I use command line apps to play media. It just kind of opens. I think it gets triggered accidentally by media keys on the keyboard or by the WTF button that headphone makers insist on adding to their products. And then it won't go away, possibly because I can never remember my Apple password.
    – intuited
    Commented Apr 24, 2020 at 14:47

You must log in to answer this question.

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