Reputation: 483
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.
Upvotes: 6
Views: 6000
Reputation: 40961
In my case I had an Xcode project for an iOS app that contained a nested Package.swift that described modules for my app.
At some point I ran swift build
in the terminal and it generated a .build
folder with artifacts.
Xcode must've picked these up as files for the project, resulting in the error. After removing the .build
folder I was able to build and run in the Simulator again.
Upvotes: 1
Reputation: 1016
I had same problem. cleaning the project build directory fixed the issue for me.
Upvotes: 1
Reputation: 17229
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
.
Upvotes: 12
Reputation: 187
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.
Upvotes: 0