Summary
You may get an Infrastructure Error when running an iOS test with an app built on Apple's Silicon.
The error thrown by Appium looks something like:
2022-09-30 19:05:08:244 - [debug] [simctl] Error running 'install': An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=4):
“App List” Needs To Be Updated
This app needs to be updated by the developer to work on this version of iOS.
Failed to find matching arch for input file: /Users/chef/Library/Developer/CoreSimulator/Devices/12D3516B-1180-4A8B-9DA5-2106952D0BF0/data/Library/Caches/com.apple.mobile.installd.staging/temp.NwG4cE/extracted/App List.app/App List
Underlying error (domain=MIInstallerErrorDomain, code=15):
Failed to find matching arch for input file: /Users/chef/Library/Developer/CoreSimulator/Devices/12D3516B-1180-4A8B-9DA5-2106952D0BF0/data/Library/Caches/com.apple.mobile.installd.staging/temp.NwG4cE/extracted/App List.app/App List
2022-09-30 19:05:08:245 - [XCUITest] Got an error on '/var/folders/3n/z0_2p7gn03q5x5mt40c4lj1m0000kr/T/2022830-3006-wfoxxq.kzv8/App List.app' install: Error running 'install': An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=4):
This can happen because of how the app is built and the fact that Debug Simulator builds are built for the Active Architecture Only. Due to the app being built on an Apple Silicon machine this would be arm64 but Sauce's Simulators use x86_64
How do I know if my app is built for x86_64 or arm64?
Easiest thing is to get the .app and run the following:
lipo -info /Users/enriquegonzalez/Desktop/AppName.app/AppName
where AppName is the name of your app.
An example of this would look like:
lipo -info /Users/enriquegonzalez/Desktop/SimpleLocationApp.app/SimpleLocationApp
This should return something like so:
Architectures in the fat file: /Users/enriquegonzalez/Desktop/SimpleLocationApp.app/SimpleLocationApp are: x86_64 arm64
If you do not see x86_64 and only see arm64 it likely means you will see this error when running your tests.
Solution
To fix this you'll need to change how the app is built when in Debug mode.
Under your Project go to Build Settings and locate the "Build Active Architecture Only" option and under Debug switch from Yes to No
You can see screenshot for how this would look like
Another alternative would be to create a custom scheme that builds the Simulator app w/ Release parameters and therefore including all active archs but that is something that is out of scope for this KB.