Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
This is a recording of how the script is supposed to work in Sequoia 15.3.
The error displayed in the video is due to Rosetta not ever being used in that virtual machine.
 
Re bogdanw's updated Script for Sequoia:
It works.

I get this alert when iTunes first launches:
View attachment 2473933

But... it can be dismissed, and then things seem to work as they should.

Thanks!
Same followed by another.

My solution - went back to 13.7.2 ? (previous increment version anyway) and I’m sticking there until I have to move to the separate apps. My iMac won’t do anything above Ventura anyway.
 
  • Like
Reactions: B4U
First of all, thank you bogdanw for all your work and discoveries for keeping iTunes alive!

Unfortunately I'm running into an issue—the iPhone's contents don't seem to be recognized, nor is USB sync able to function—seems to fail on the "Determining tracks to sync" step.

A peer into Console > Log Reports > launchd.log seems to show that during this step, both iTunes and AppleMobileDevice processes attempt to make calls to com.apple.TrustEvaluationAgent, and each time, the operation is not permitted.

Any way to fix this and get USB sync working again?

Running iTunes 12.9.5.5 on macOS 14.7.3 on a 2018 Macbook Pro i9.

Code:
25-02-07 02:58:57.091321 (user/501) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = iTunes[90581], error = 1: Operation not permitted
2025-02-07 02:58:57.091347 (gui/501 [100004]) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = iTunes[90581], error = 1: Operation not permitted
2025-02-07 02:58:57.126225 (user/501) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = iTunes[90581], error = 1: Operation not permitted
2025-02-07 02:58:57.126240 (gui/501 [100004]) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = iTunes[90581], error = 1: Operation not permitted
2025-02-07 02:58:57.192444 (user/501) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = AppleMobileDevi[90589], error = 1: Operation not permitted
2025-02-07 02:58:57.192455 (gui/501 [100004]) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = AppleMobileDevi[90589], error = 1: Operation not permitted
2025-02-07 02:58:57.225631 (user/501) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = AppleMobileDevi[90589], error = 1: Operation not permitted
2025-02-07 02:58:57.225643 (gui/501 [100004]) <Warning>: failed lookup: name = com.apple.TrustEvaluationAgent, flags = 0x9, requestor = AppleMobileDevi[90589], error = 1: Operation not permitted
 
  • Love
Reactions: The Tourer
Verified iTunes having Full Disk Access and installed both packages, then restarted both Macbook and iPhone, and unfortunately the same problem persists, complete with the same console output.

Is USB sync confirmed to be working on any most recent OS version, either in macOS 14 or 15?
 
I don’t have iTunes versions created with Retroactive.

iTunes 12.6.5.3 created with the script from this thread returns „The iPhone cannot be used because it requires iTunes version 12.10.6 or later. Would you like to download the latest version of iTunes now?"

iTunes 12.9.5.5 created in a similar manner returns “iTunes cannot read the contents of the iPhone. Go to the Summary tab in iPhone preferences and click Restore to restore this iPhone to factory settings.”
 
Any way to fix this and get USB sync working again?

Running iTunes 12.9.5.5 on macOS 14.7.3 on a 2018 Macbook Pro i9.
Something you can try: exit iTunes, then open a Terminal window and type pkill AMPDeviceDiscoveryAgent. Then start iTunes and try to sync your device.

AMPDeviceDiscoveryAgent is part of the machinery involved synching devices via Finder. When I was running iTunes on Monterey, I found that it would interfere with iTunes when trying to sync iPods. I outlined a solution to get it out of the way in this post.
 
I don’t have iTunes versions created with Retroactive.

iTunes 12.6.5.3 created with the script from this thread returns „The iPhone cannot be used because it requires iTunes version 12.10.6 or later. Would you like to download the latest version of iTunes now?"

iTunes 12.9.5.5 created in a similar manner returns “iTunes cannot read the contents of the iPhone. Go to the Summary tab in iPhone preferences and click Restore to restore this iPhone to factory settings.”

Understood... looks like I may be out of luck then. I thought about clearing all the existing music from my iPhone and trying a fresh sync but that's extremely risky because it might be a one-way street that ends with missing all my music on the phone, not just the newest stuff I'm trying to sync now.

Seems like even installing without Retroactive and instead by your script is not going to repair this issue. I just wish the logging was more comprehensive so I had a better idea of what exactly is blocking it, if not this TrustEvaluationAgent. To your knowledge, is there any way of bypassing that trust handshake for the iTunes and/or AppleMobileDevice processes?


Something you can try: exit iTunes, then open a Terminal window and type pkill AMPDeviceDiscoveryAgent. Then start iTunes and try to sync your device.

AMPDeviceDiscoveryAgent is part of the machinery involved synching devices via Finder. When I was running iTunes on Monterey, I found that it would interfere with iTunes when trying to sync iPods. I outlined a solution to get it out of the way in this post.

Unfortunately as you allude to in your original (excellently written) post, this does not seem to work for newer iPhones—the example in question is an iPhone 16 Pro. I get the same error after killing that process as I do with it running.
 
Unfortunately as you allude to in your original (excellently written) post, this does not seem to work for newer iPhones—the example in question is an iPhone 16 Pro. I get the same error after killing that process as I do with it running.
Sorry about that.

I believe that iTunes 12.9.5 installed via Retroactive required that you give /bin/bash full disk access. That's because the iTunes "binary" was actually a shell script that set some environment variables and such before launching the real iTunes binary. If that's what you're running, you might check that.

Have you tried syncing the phone using Finder? Or at least backing the phone up using Finder? It might be interesting to know if that results in the same errors.

EDIT: Also (and this might be a long shot) try using a different usb port.
 
I just wish the logging was more comprehensive so I had a better idea of what exactly is blocking it, if not this TrustEvaluationAgent. To your knowledge, is there any way of bypassing that trust handshake for the iTunes and/or AppleMobileDevice processes?
I suspect the change comes from the recent fixes for AppleMobileFileIntegrity.
Probably iTunes needs to be properly signed in order to access data from iOS devices,

"AppleMobileFileIntegrity
Available for: macOS Sonoma
Impact: An app may be able to access sensitive user data
Description: A downgrade issue was addressed with additional code-signing restrictions.
CVE-2025-24109: Bohdan Stasiuk (@Bohdan_Stasiuk)

AppleMobileFileIntegrity
Available for: macOS Sonoma
Impact: An app may be able to modify protected parts of the file system
Description: A downgrade issue affecting Intel-based Mac computers was addressed with additional code-signing restrictions.
CVE-2025-24122: Mickey Jin (@patch1t)"

https://support.apple.com/en-us/122069
 
Updated script for Sequoia

AppleScript:
set theDMG to choose file with prompt "Please select iTunes dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "cd ~/tmp/iTunesX.pkg; cat Payload | gunzip -dc |cpio -i; ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app ~/tmp/iTunes.app;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.9' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "ditto ~/tmp/iTunes.app /Applications/iTunes.app"
do shell script "rm -r ~/tmp"
do shell script "codesign --force --deep --sign - /Applications/iTunes.app"
do shell script "open /Applications/iTunes.app"

Tested with iTunes12.6.5.dmg and iTunes12.8.3.dmg in a Sequoia 15.2 virtual machine.
I can confirm your script works for iTunes 12.8.3 under Sequoia 15.3 and 15.3.1 on an M1 Air. However, since I really like 10.7 CoverFlow, I was looking to get that working again as it was in 15.2 and previous versions and was installed with Retroactive. I first tried to use your script with a 10.7 installer but it wouldn't expand it. I had researched some code signature issues but those commands did not work but yours does:

“codesign --force --deep --sign - /Applications/iTunes.app”

but I had to apply it to a backup of my 10.7 iTunes app not the new one that Retroactive installed. Not sure why that is the case but I'm just glad it's working again. Thank you so much for posting your scripts as I'm sure it's helped many others besides myself.
 
  • Like
Reactions: bogdanw
The iTunes10.7 dmg mounts as /Volumes/iTunes 10.7, different from the rest of iTunes dmg files that mount as /Volumes/iTunes. So that caused the expand error.
Script adapted for iTunes10.7
AppleScript:
set theDMG to choose file with prompt "Please select the iTunes 10.7 dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes\\ 10.7/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount  /Volumes/iTunes\\ 10.7"
do shell script "cd ~/tmp/iTunesX.pkg; cat Payload | gunzip -dc |cpio -i; ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app ~/tmp/iTunes.app;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.9' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "ditto ~/tmp/iTunes.app /Applications/iTunes.app"
do shell script "rm -r ~/tmp"
do shell script "codesign --force --deep --sign - /Applications/iTunes.app"
do shell script "open /Applications/iTunes.app"

Link for the iTunes10.7.dmg https://secure-appldnld.apple.com/iTunes10/041-7195.20120912.d3uzQ/iTunes10.7.dmg
 
The iTunes10.7 dmg mounts as /Volumes/iTunes 10.7, different from the rest of iTunes dmg files that mount as /Volumes/iTunes. So that caused the expand error.
Script adapted for iTunes10.7
AppleScript:
set theDMG to choose file with prompt "Please select the iTunes 10.7 dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes\\ 10.7/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount  /Volumes/iTunes\\ 10.7"
do shell script "cd ~/tmp/iTunesX.pkg; cat Payload | gunzip -dc |cpio -i; ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app ~/tmp/iTunes.app;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.9' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "ditto ~/tmp/iTunes.app /Applications/iTunes.app"
do shell script "rm -r ~/tmp"
do shell script "codesign --force --deep --sign - /Applications/iTunes.app"
do shell script "open /Applications/iTunes.app"

Link for the iTunes10.7.dmg https://secure-appldnld.apple.com/iTunes10/041-7195.20120912.d3uzQ/iTunes10.7.dmg
Thanks so much for that information. I wasn't sure how to get around that error.
 
I suspect the change comes from the recent fixes for AppleMobileFileIntegrity.
Probably iTunes needs to be properly signed in order to access data from iOS devices,

"AppleMobileFileIntegrity
Available for: macOS Sonoma
Impact: An app may be able to access sensitive user data
Description: A downgrade issue was addressed with additional code-signing restrictions.
CVE-2025-24109: Bohdan Stasiuk (@Bohdan_Stasiuk)

AppleMobileFileIntegrity
Available for: macOS Sonoma
Impact: An app may be able to modify protected parts of the file system
Description: A downgrade issue affecting Intel-based Mac computers was addressed with additional code-signing restrictions.
CVE-2025-24122: Mickey Jin (@patch1t)"

https://support.apple.com/en-us/122069

I assume if I've already done the basic codesign for iTunes.app and it's not working, safe to say I'm outta luck? I'd try downgrading to 12.6 if that will work and not cause forward-compatibility issues with my library, but what are the chances that's any better?
 
I assume if I've already done the basic codesign for iTunes.app and it's not working, safe to say I'm outta luck? I'd try downgrading to 12.6 if that will work and not cause forward-compatibility issues with my library, but what are the chances that's any better?
What version of iTunes are you trying to run and on what macOS? On Intel or on Apple Silicon? Was it created with Retroactive or with the script from this thread?
 
Updated script for Sequoia

AppleScript:
set theDMG to choose file with prompt "Please select iTunes dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "cd ~/tmp/iTunesX.pkg; cat Payload | gunzip -dc |cpio -i; ditto ~/tmp/iTunesX.pkg/Applications/iTunes.app ~/tmp/iTunes.app;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.9' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.9 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "ditto ~/tmp/iTunes.app /Applications/iTunes.app"
do shell script "rm -r ~/tmp"
do shell script "codesign --force --deep --sign - /Applications/iTunes.app"
do shell script "open /Applications/iTunes.app"

Tested with iTunes12.6.5.dmg and iTunes12.8.3.dmg in a Sequoia 15.2 virtual machine.
Hey there! I just tried using your script and I get a ton of errors, mostly a whole list of things with "permission denied". Any idea how to fix? Here's a screenshot.

This is me trying to install iTunes 12.8.3. Is there any sort of permissions in System Preferences that I need to enable? I have SIP turned off, having previously used iTunes through Retroactive (but that doesn't work on Sequoia anymore).

I am on Sequoia 15.3 (so the latest) and trying to install 12.8.3. Previously, I had 12.9.5.5 installed via Retroactive, and up until I updated to 15.3, it was working, but this morning when I tried to launch it it gave me a CODESIGNING 1 Taskgated Invalid Signature error upon the crash and now the icon just bounces once and doesn't open at all. Any help would be greatly appreciated! Mulțumesc mult Bogdan!
 

Attachments

  • Screenshot 2025-02-17 at 5.55.03 PM.png
    Screenshot 2025-02-17 at 5.55.03 PM.png
    1.2 MB · Views: 8
Last edited:
  • Like
Reactions: bogdanw
Hey there! I just tried using your script and I get a ton of errors, mostly a whole list of things with "permission denied". Any idea how to fix? Here's a screenshot.

This is me trying to install iTunes 12.8.3. Is there any sort of permissions in System Preferences that I need to enable? I have SIP turned off, having previously used iTunes through Retroactive (but that doesn't work on Sequoia anymore).

I am on Sequoia 15.3 (so the latest) and trying to install 12.8.3. Previously, I had 12.9.5.5 installed via Retroactive, and up until I updated to 15.3, it was working, but this morning when I tried to launch it it gave me a CODESIGNING 1 Taskgated Invalid Signature error upon the crash and now the icon just bounces once and doesn't open at all. Any help would be greatly appreciated! Mulțumesc mult Bogdan!
Okay so I ran it again having deleted the version of iTunes that I had in my Applications folder that was installed via Retroactive, now it's just saying error: permission denied but just for the tmp folder it's making in my Users folder. Any assistance would be greatly appreciated, thank you!
 

Attachments

  • Screenshot 2025-02-17 at 6.09.02 PM.png
    Screenshot 2025-02-17 at 6.09.02 PM.png
    980.6 KB · Views: 8
Okay so I ran it again having deleted the version of iTunes that I had in my Applications folder that was installed via Retroactive, now it's just saying error: permission denied but just for the tmp folder it's making in my Users folder. Any assistance would be greatly appreciated, thank you!
Okay so I put the tmp folder in the trash and then I changed the permissions of the user folder to be read+write for everyone not just me, and it installed perfectly! Thank you for this script, you're a lifesaver!

SO TL;DR: Confirmed this script works on OSx Sequoia 15.3 installing iTunes 12.8.3. But you need to change the permissions of your user folder to be read+write for everyone during install, then you can change it back I'm assuming. Cheers!
 
Okay so I put the tmp folder in the trash and then I changed the permissions of the user folder to be read+write for everyone not just me, and it installed perfectly! Thank you for this script, you're a lifesaver!

SO TL;DR: Confirmed this script works on OSx Sequoia 15.3 installing iTunes 12.8.3. But you need to change the permissions of your user folder to be read+write for everyone during install, then you can change it back I'm assuming. Cheers!
I used the script for 12.8.3 with no issues and I didn't need to change any permissions nor disable SIP and I'm also running 15.3. It sounds like you're not an admin for your user account or your previous installation left some files behind that caused your problem.
 
For anyone else encountering the ditto error: Retroactive asks for your/admin password to install iTunes, the script does not. As a result, the script can not overwrite the iTunes app created by Retroactive.

But at that point in the script, the new iTunes version is already created in ~/tmp/, so all you have to do is move it into /Applications.

If the script fails before deleting the ~/tmp folder ("rm -r ~/tmp"), before running the script a second time, delete ~/tmp from Finder or Terminal.
 
  • Like
Reactions: VintageMacGS
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.