Xcode 10.2 Failed to Run App on Simulator with iOS < 10
This is a known bug affecting iOS 8.x and 9.x. You can work around it by creating /usr/lib/swift
directories in the relevant simulator runtime root.
Downloaded simulator runtimes are located in /Library/Developer/CoreSimulator/Profiles/Runtimes
.
For example, to fix the iOS 9.3 simulator:
sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
Me also got the same problem when run in iOS 9.0 simulator.
From https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_1_release_notes
Simulators for iOS 9.3 and earlier might fail to launch Swift apps with the message: “dyld: Library not loaded: /usr/lib/libauto.dylib”. (49326587) Workaround: Run the following command in Terminal for the relevant version of iOS:
sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
For this apple given above solution in that link.
Simply
--> open Terminal
--> Type this line with your required version (In my case i changed into iOS 9.3 to iOS 9.0)
Ex: sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
--> Enter password
--> Now clean Xcode and run again
This above solution worked for me.