美文网首页iOS高级开发
macOS10.14 mojave安装低版本iTunes,提示“

macOS10.14 mojave安装低版本iTunes,提示“

作者: tanpengsccd | 来源:发表于2018-10-29 16:16 被阅读252次

此为搬运帖子

10.13

只有iTunes 12.6.X才能管理部署app(下载,安装)
官方方案:10.13可用,10.14不可
https://support.apple.com/zh-cn/HT208079

10.14

先下载10.13可用的iTunes
利用apple script 脚本:(以下二选一),将下面代码 贴入 script Editor,运行

会删除原来iTunes ,可能需要SIP 关闭 (也可直接下载https://gist.githubusercontent.com/tanpengsccd/fd7579c9b065f3c84641a2e4b0b5b46e/raw/d10fe299a4e3e05a4fa3870fa71cebcde0fdf493/10.14%2520install%2520itunes.scpt )

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

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 Library.itl 错误,删掉就ok

sudo rm ~/Music/iTunes/iTunes\ Library.itl
参考:
https://forums.macrumors.com/threads/apples-special-version-of-itunes-that-still-has-an-app-store-currently-incompatible-with-macos-mojave.2143244/page-4#post-26592234

相关文章

网友评论

    本文标题:macOS10.14 mojave安装低版本iTunes,提示“

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