与此斗争了好几个小时。我已经从App Store下载了最新的安装程序,希望能够在将其更新到5.1后再次在设备上运行我的代码。没那么快!我得到一个神秘的错误,说安装失败了。这几乎就好像它告诉我“你的安装因为失败而失败”。谢谢,船长Obvious。
调查/var/log/install.log我看到这个(失败前最后几行的片段):
Mar 11 21:11:52 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[577]: Running Install Scripts . . .
Mar 11 21:11:52 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[579]: Begin script: AlertAll.sh
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro installd[567]: ./preinstall: sudo: unknown user: Yuri
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[582]: End script: AlertAll.sh
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[583]: Begin script: cleanUp
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[586]: End script: cleanUp
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[587]: Begin script: preflight
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[590]: End script: preflight
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[591]: Begin script: writelocation
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[594]: End script: writelocation
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[595]: Begin script: zzzcleanup
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[599]: End script: zzzcleanup
Mar 11 21:11:53 Yuriy-Aleksyeyevs-MacBook-Pro _securityagent[600]: 5 Install Scripts run.
Mar 11 21:13:18 Yuriy-Aleksyeyevs-MacBook-Pro installd[567]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “DeveloperTools.pkg”." UserInfo=0x7f9d46575c90 {NSFilePath=./preinstall, NSURL=file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg, PKInstallPackageIdentifier=com.apple.pkg.DeveloperToolsLeo, NSLocalizedDescription=An error occurred while running scripts from the package “DeveloperTools.pkg”.} {
NSFilePath = "./preinstall";
NSLocalizedDescription = "An error occurred while running scripts from the package \U201cDeveloperTools.pkg\U201d.";
NSURL = "file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg";
PKInstallPackageIdentifier = "com.apple.pkg.DeveloperToolsLeo";
}
Mar 11 21:13:18 Yuriy-Aleksyeyevs-MacBook-Pro installer[560]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “DeveloperTools.pkg”." UserInfo=0x7f8bc3197060 {NSFilePath=./preinstall, NSURL=file://localhost/Applications/Install%20Xcode.app/Contents/Resources/Packages/DeveloperTools.pkg, PKInstallPackageIdentifier=com.apple.pkg.DeveloperToolsLeo, NSLocalizedDescription=An error occurred while running scripts from the package “DeveloperTools.pkg”.}
Mar 11 21:13:19 Yuriy-Aleksyeyevs-MacBook-Pro installer[560]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
我确保我的用户名在sudoers列表中。我还能错过什么?我重新启动后尝试安装它,除了安装程序之外什么都没有运行。
PS:我还没有尝试删除之前安装的Xcode。我永远不会记得那是必要的,而且我宁愿继续在模拟器上开发而不是完全丧失这种能力。
答案 0 :(得分:0)
创建了一个具有管理权限的新“管理员”用户,并通过该帐户成功安装了XCode。
答案 1 :(得分:0)
从此处找到并复制了解决方案:https://discussions.apple.com/thread/3863980?start=0&tstart=0