且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Xcode:尝试在iOS模拟器中运行应用程序时出现无效的符号链接错误

更新时间:2021-08-01 03:34:53

当您的应用程序包含指向应用程序包外部的符号链接时,通常会发生该错误。在为设备或模拟器进行构建时,Xcode会创建应用程序捆绑包,然后将其复制出来以进行MobileInstallation进行安装或更新。 MobileInstallation将不会安装符号链接到应用程序捆绑包以外位置的应用程序。

That error usually happens when your app contains a symlink that points outside the app bundle. When building for device or the Simulator, Xcode creates the app bundle, then copies it out for MobileInstallation to do the install or update. MobileInstallation will not install an app that has symlinks to locations outside the app bundle.

您是否有任何特定于模拟器的构建脚本或步骤?您的捆绑包中是否包含任何符号链接?在Xcode中打开产品组。右键单击< name> .app,然后选择在Finder中显示。右键单击该应用程序,然后选择显示包装内容。检查应用程序是否存在任何符号链接。您也可以在终端中打开该目录,然后使用 ls -al 。任何链接的第一个位置都将包含 l 字符。

Do you have any simulator-specific build scripts or steps? Does your bundle contain any symlinks? Open the Products group in Xcode. Right-click on "<name>.app" and select "Show in Finder". Right-click the app and select "Show Package Contents". Examine the app for the presence of any symlinks. You can also open that directory in Terminal and use ls -al. Any links will have an l character in the first position.

另一种可能性是您存在文件权限问题或其他文件系统损坏。运行磁盘实用程序以检查错误。假设一切正常,您可以使用 xcrun simctl全部清除重置模拟器。

The other possibility is you have a file permission problem or other filesystem corruption. Run Disk Utility to check for errors. Assuming everything is OK, you can reset your Simulators with xcrun simctl erase all.