美文网首页iOS开发实用技术iOS开发进阶
macOS 10.14 mojave安装低版本iTunes 12

macOS 10.14 mojave安装低版本iTunes 12

作者: 我叫Vincent | 来源:发表于2019-03-28 15:16 被阅读24次

    下载iTunes 12.6版本:https://support.apple.com/zh-cn/HT208079

    安装低版本iTunes

    利用脚本编辑器运行脚本安装低版本iTunes:

    关闭SIP系统完整性保护

    • 打开Mac终端输入命令:csrutil status
    $ csrutil status
    
    • 默认情况下是开启的
    System Integrity Protection status: enabled.
    
    • 重启电脑,按住键盘上面的cmmand+r,进入修复模式
      点击实用工具,选择终端


      选择终端

    输入命令:csrutil disable

    $ csrutil disable
    
    • 再次重启电脑

    • 建议这里记得安装完成后改回来,开启SIP和前面的操作一致,在修复模式下,输入命令csrutil enabled

    $ csrutil enabled
    

    打开脚本编辑器,将以下代码复制到脚本编辑器运行(卸载iTunes并重装)

    set question to display dialog "Delete iTtunes?" buttons {"Yes", "No"} default button 1
    set answer to button returned of question
    if answer is equal to "Yes" then
        do shell script "rm -rf /Applications/iTunes.app" with administrator privileges
        display dialog "iTunes was deleted" buttons {"Ok"}
        set theDMG to choose file with prompt "Please select iTunes 12.6 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 "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
        do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
        do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
        do shell script "hdiutil unmount /Volumes/iTunes/"
        do shell script "rm -rf ~/tmp"
    end if
    if answer is equal to "No" then
        display dialog "iTunes was not deleted" buttons {"Ok"}
        return
    end if
    
    set question to display dialog "Install iTtunes?" buttons {"Yes", "No"} default button 1
    set answer to button returned of question
    if answer is equal to "Yes" then
        do shell script "open ~/Desktop/iTunes.pkg"
        return
    end if
    if answer is equal to "No" then
        display dialog "Modified iTunes.pkg saved on desktop" buttons {"Ok"}
        return
    end if
    
    命令行

    运行后根据提示卸载安装。

    如果提示 iTunes Library.itl 错误,打开终端运行命令:sudo rm ~/Music/iTunes/iTunes\ Library.itl

    $ sudo rm ~/Music/iTunes/iTunes\ Library.itl
    

    或者:

    display dialog "Please select iTunes 12.6 dmg file" buttons {"Ok"}
    set theDMG to choose file with prompt "Please select iTunes 12.6 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 "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
    do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
    do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
    do shell script "hdiutil unmount /Volumes/iTunes/"
    do shell script "rm -rf ~/tmp"
    
    set question to display dialog "Install iTtunes?" buttons {"Yes", "No"} default button 1
    set answer to button returned of question
    if answer is equal to "Yes" then
        do shell script "open ~/Desktop/iTunes.pkg"
        return
    end if
    if answer is equal to "No" then
        display dialog "Modified iTunes.pkg saved on desktop" buttons {"Ok"}
        return
    end if
    

    运行脚本卸载iTunes后,按照脚本提示选择12.6版本iTunes的安装包进行安装即可。


    安装成功 43534534.jpg

    相关文章

      网友评论

        本文标题:macOS 10.14 mojave安装低版本iTunes 12

        本文链接:https://www.haomeiwen.com/subject/hyagvqtx.html