Xcode: invalid symlink error when trying to run app in iOS simulator

和自甴很熟 提交于 2019-12-10 15:18:45

问题


At the end of my app's compilation phase, I see the following error:

This is just some temp directory that's created every time I run. I tried deleting it to no avail.

The app runs fine on device.

Any help would be much appreciated.


回答1:


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.

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.

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.




回答2:


I had same problem once, then i deleted the simulator from opened window after followed way "Set the active scheme -> Add additional simulator".After that i added a new simulator. I'm not sure about the solution for you.

Second way to solve the problem (in my opinion), check the simulator path "Finder -> Library -> Developer -> CoreSimulator -> Devices" like this. After that, find your project simulator then delete it :) and run the project on the same simulator again.

I hope it works for you. Good luck.




回答3:


I had same problem. cleaning the project build directory fixed the issue for me.



来源:https://stackoverflow.com/questions/43282975/xcode-invalid-symlink-error-when-trying-to-run-app-in-ios-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!