How to avoid iTunes' "Do you want the application iTunes.app to accept incoming network connections?"?
El Capitan

Uninstalling and reinstalling iTunes is the only way I could solve this issue.

As this (battery-draining, maldesigned) page warns you, you can't just drag iTunes to the Trash. El Capitan will warn you that it's part of the OS. Get Info, clicking on the padlock, and giving everyone read+write permission will get over that.

The next step is to download it. Surprise: iTunes is not available on the App Store. But you can download a dmg just fine here.

After 5 minutes of use I can confirm the message no longer appears.

I can also confirm that the music collection appears unharmed.

Pre El Capitan

Thanks to owlswipe's hint, the solution follows.

In System Preferences, under Security &amp; Privacy



Click "Firewall Options"



and allow incoming connections for iTunes.

It's not clear why "incoming connections" is an option for iTunes.