Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run UITest on iphone 4s simulator with xcode 9

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?

like image 466
thibaut noah Avatar asked Oct 26 '17 14:10

thibaut noah


People also ask

How do I get Xcode simulator on my iPhone 5s?

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.

How do I add a simulator device to 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.

How run iOS build on simulator?

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.


2 Answers

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.

like image 165
Charlie Seligman Avatar answered Oct 22 '22 00:10

Charlie Seligman


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.

UITest target Build Settings

like image 28
widemos Avatar answered Oct 21 '22 23:10

widemos