macOS,更新到 Monterey 12.6 后缺少命令行开发工具

r0n*_*0ng 69 python git command-line-tool macos

我的 Apple MacBook pro M1 2020 自动更新到Monterey 12.6最近。更新后,我必须同意 Xcode 协议/许可证。之后,我发现两者pythongit不再正常工作。我收到一个弹出窗口:The \xe2\x80\x9cgit\xe2\x80\x9d command requires the command line developer tools.但是在我安装该工具后,弹出窗口又回来并要求我递归安装该工具。有什么建议来解决这个问题吗?

\n

当我运行该git命令时,出现以下错误消息:

\n
2022-09-15 16:35:42.216 xcodebuild[5621:29269] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn\xe2\x80\x99t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle \xe2\x80\x9cIDESimulatorAvailability\xe2\x80\x9d couldn\xe2\x80\x99t be loaded.}, dyldError = dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0000): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'\n2022-09-15 16:35:42.235 xcodebuild[5621:29269] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot2/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21303/DVTFoundation/PlugInArchitecture/DataModel/DVTPlugIn.m:374\nDetails:  Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin)\nPlease ensure Xcode packages are up-to-date \xe2\x80\x94 try running 'xcodebuild -runFirstLaunch'.\n\nNSBundle error: Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn\xe2\x80\x99t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n  Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n  Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle \xe2\x80\x9cIDESimulatorAvailability\xe2\x80\x9d couldn\xe2\x80\x99t be loaded.}\nObject:   <DVTPlugIn: 0x600003f1fd40>\nMethod:   -loadAssertingOnError:error:\nThread:   <_NSMainThread: 0x600001b542c0>{number = 1, name = main}\nHints: \n\nBacktrace:\n  0  0x0000000101c19410\n  1  0x0000000101c18aec\n  2  0x0000000101c18c6c\n  3  0x0000000101ac72ac\n  4  0x0000000101a8d118\n  5  0x0000000101a8b528\n  6  0x00000001bc9701b4\n  7  0x00000001bc97f414\n  8  0x0000000101c5d58c\n  9  0x0000000101c394b0\n 10  0x0000000101a8b3c0\n 11  0x0000000101a8b5e0\n 12  0x0000000102b4f2ec\n 13  0x0000000102b4eae0\n 14  0x0000000102b4e1e8\n 15  0x00000001004ec324\n 16  0x000000010027de0c\nsh: line 1:  5626 Abort trap: 6           /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null\ngit: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find git 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)\nxcode-select: Failed to locate 'git', requesting installation of command line developer tools.\n> putty\ndbus[6750]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!\n
Run Code Online (Sandbox Code Playgroud)\n

小智 134

我昨天遇到了同样的错误,花了一段时间才注意到错误本身有解决方案:)

\n
Please ensure Xcode packages are up-to-date \xe2\x80\x94 try running 'xcodebuild -runFirstLaunch'.\n
Run Code Online (Sandbox Code Playgroud)\n

事实上,跑步xcodebuild -runFirstLaunch为我解决了这个问题!

\n

  • @mrbolichi 您是如何在没有管理员许可的情况下启动更新的?如果没有管理员权限,您将无法解决此问题。这是联系 IT 支持人员修复问题的正当理由。 (4认同)

小智 19

跑步

\n
sudo xcode-select --install\n
Run Code Online (Sandbox Code Playgroud)\n

系统可能会提示您接受许可证。这样做。

\n

如果您尝试运行 git,您\xe2\x80\x99 仍然会收到错误,请运行以下命令:

\n
sudo xcode-select -switch /Library/Developer/CommandLineTools\n
Run Code Online (Sandbox Code Playgroud)\n

现在您应该能够使用 git 了。

\n