Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

At the end of my app's compilation phase, I see an invalid symlink 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.

like image 727
Alec Avatar asked Apr 07 '17 16:04

Alec


2 Answers

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.

like image 128
russbishop Avatar answered Nov 15 '22 14:11

russbishop


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

like image 1
Moaz Saeed Avatar answered Nov 15 '22 14:11

Moaz Saeed