I'm trying to setup some UI tests but can't get them to run on devices running pre iOS 12.3.
Even if I start a fresh swift project with 'include UI tests' ticked and try to run the UI tests straight away on a pre iOS 12.3 device I get the following:
2019-05-22 15:42:41.543630+0100 testUITests-Runner[461:45630] Running tests... 2019-05-22 15:42:41.601954+0100 testUITests-Runner[461:45630] The bundle “testUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. 2019-05-22 15:42:41.602043+0100 testUITests-Runner[461:45630] (dlopen_preflight(/var/containers/Bundle/Application/50D1F2AB-69B9-4C3D-B36B-F84F838E3301/testUITests-Runner.app/PlugIns/testUITests.xctest/testUITests): Library not loaded: @rpath/libswiftCore.dylib Referenced from: /var/containers/Bundle/Application/50D1F2AB-69B9-4C3D-B36B-F84F838E3301/testUITests-Runner.app/PlugIns/testUITests.xctest/testUITests Reason: image not found)
I've seen various questions and answers for the same errors going back to betas of Xcode 6 but none of the suggestions there have helped, including:
- clean build
- changing certificate trust rules
- importing CoreLocation
- including a dummy swift file
- altering runpath search paths (seems that's been fixed in Xcode)
- changing the 'always embed swift standard libraries' build setting
I started on Xcode 10.2 and found the issue, upgrading to Xcode 10.3 hasn't helped.
It was working fine on the 12.2 simulator but fails on a device.