Project can build properly on iphone 4s simulator but trying to run UITest on it gives me the error :
The bundle “MyappUITests” couldn’t be loaded because it doesn’t contain a version for the current architecture. Try installing a universal version of the bundle.
Can't seem to figure out the root cause for this, tests are running properly on every other simulator.
Any thoughts?
Need to add simulator from simulators by clicking + icon the bottom right of the simulator list. Then it will show in the simulators list in the Xcode.
Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download. When a simulator is opened from AppStudio, AppStudio Player automatically installs (if necessary) and opens in it.
To run your app in Simulator, choose an iOS simulator—for example, iPhone 6 Plus, iPad Air, or iPhone 6 + Apple Watch - 38mm—from the Xcode scheme pop-up menu and click Run. Xcode builds your project and then launches the most recent version of your app running in Simulator on your Mac screen, as shown in Figure 1-1.
I experienced this error while trying to get a new M1 Macbook Pro to run XCUITests.
I had set Excluded Architectures (in the Build Settings) for Simulator SDK to be arm64 for both the main target and the XCUITests target. Removing this exclusion from the XCUITests target fixed this error.
Hope this helps some others who are having a nightmare like me with the new M1 Macbooks... wish I'd never upgraded.
I have solved this problem setting "iOS Deployment Target" of the UITest target to iOS 9.0. It was created with 11.1 value by Xcode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With