Cant run IOS build on appium inspector

my dev team is creating a build for me and i got build with .app
and if i click start session button in appium Inspector i got this error

Failed to create session. An unknown server-side error occurred while processing the command. Original error: Simulator architecture is unsupported by the ‘/Users/nifargo/Downloads/DKV.app’ application. Make sure the correct deployment target has been selected for its compilation in Xcode.

How can we fix it?

here are my settings
{
“appium:app”: “/Users/nifargo/Downloads/DKV.app”,
“appium:automationName”: “XCUITest”,
“appium:deviceName”: “iPhone 8”,
“appium:platformVersion”: “16.4”,
“platformName”: “iOS”,
“appium:udid”: “040B6527-7F82-4F42-A78E-CE92DBA6D7D7”
}

.app build for simulator, .ipa for phone

yes and im using simulator - xCode
but my problem is - icant open the build file in Appium inspector - so that is why i have a problem

Check what your app build for!

  1. Where you start your app: on macOS with arm CPU or Intel?
  2. What version on Appium server and xcuitest driver you using? Possibly they just outdated?
  3. also check logs in DEBUG mode. there should be more info
  1. on macOs with Apple M1 Pro but my dev who is making a build for me has masOs with Intel
  2. Appium 2.0.0-rc.5, [email protected] - no they are in the latest versions
  3. Here is logs and i didnt find nothing new - the same problem that i sent before

[Appium] Welcome to Appium v2.0.0-rc.5

[Appium] Non-default server args:

[Appium] {

[Appium] debugLogSpacing: true

[Appium] }

[Appium] Attempting to load driver uiautomator2…

[debug] [Appium] Requiring driver at /Users/nifargo/.appium/node_modules/appium-uiautomator2-driver

[Appium] Attempting to load driver xcuitest…

[debug] [Appium] Requiring driver at /Users/nifargo/.appium/node_modules/appium-xcuitest-driver

[Appium] Appium REST http interface listener started on http://0.0.0.0:4723

[Appium] You can provide the following URLS in your client code to connect to this server:

[Appium] http://127.0.0.1:4723/ (only accessible from the same host)

[Appium] http://192.168.1.32:4723/

[Appium] Available drivers:

[Appium] - [email protected] (automationName ‘UiAutomator2’)

[Appium] - [email protected] (automationName ‘XCUITest’)

[Appium] No plugins have been installed. Use the “appium plugin” command to install the one(s) you want to use.

[HTTP] --> POST /session

[HTTP] {“capabilities”:{“alwaysMatch”:{“appium:app”:"/Users/nifargo/Downloads/DKV.app",“appium:automationName”:“XCUITest”,“appium:deviceName”:“iPhone 8”,“appium:platformVersion”:“16.4”,“platformName”:“iOS”,“appium:udid”:“040B6527-7F82-4F42-A78E-CE92DBA6D7D7”,“appium:includeSafariInWebviews”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]},“desiredCapabilities”:{“appium:app”:"/Users/nifargo/Downloads/DKV.app",“appium:automationName”:“XCUITest”,“appium:deviceName”:“iPhone 8”,“appium:platformVersion”:“16.4”,“platformName”:“iOS”,“appium:udid”:“040B6527-7F82-4F42-A78E-CE92DBA6D7D7”,“appium:includeSafariInWebviews”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true}}

[debug] [AppiumDriver@e4d1] Calling AppiumDriver.createSession() with args: [{“appium:app”:"/Users/nifargo/Downloads/DKV.app",“appium:automationName”:“XCUITest”,“appium:deviceName”:“iPhone 8”,“appium:platformVersion”:“16.4”,“platformName”:“iOS”,“appium:udid”:“040B6527-7F82-4F42-A78E-CE92DBA6D7D7”,“appium:includeSafariInWebviews”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},null,{“alwaysMatch”:{“appium:app”:"/Users/nifargo/Downloads/DKV.app",“appium:automationName”:“XCUITest”,“appium:deviceName”:“iPhone 8”,“appium:platformVersion”:“16.4”,“platformName”:“iOS”,“appium:udid”:“040B6527-7F82-4F42-A78E-CE92DBA6D7D7”,“appium:includeSafariInWebviews”:true,“appium:newCommandTimeout”:3600,“appium:connectHardwareKeyboard”:true},“firstMatch”:[{}]}]

[debug] [AppiumDriver@e4d1] Event ‘newSessionRequested’ logged at 1692609021128 (11:10:21 GMT+0200 (Central European Summer Time))

[Appium] Attempting to find matching driver for automationName ‘XCUITest’ and platformName ‘iOS’

[Appium] The ‘xcuitest’ driver was installed and matched caps.

[Appium] Will require it at /Users/nifargo/.appium/node_modules/appium-xcuitest-driver

[debug] [Appium] Requiring driver at /Users/nifargo/.appium/node_modules/appium-xcuitest-driver

[AppiumDriver@e4d1] Appium v2.0.0-rc.5 creating new XCUITestDriver (v4.32.11) session

[AppiumDriver@e4d1] Checking BaseDriver versions for Appium and XCUITestDriver

[AppiumDriver@e4d1] Appium’s BaseDriver version is 9.3.15

[AppiumDriver@e4d1] XCUITestDriver’s BaseDriver version is 9.3.15

[debug] [XCUITestDriver@145d] Creating session with W3C capabilities: {

[debug] [XCUITestDriver@145d] “alwaysMatch”: {

[debug] [XCUITestDriver@145d] “platformName”: “iOS”,

[debug] [XCUITestDriver@145d] “appium:app”: “/Users/nifargo/Downloads/DKV.app”,

[debug] [XCUITestDriver@145d] “appium:automationName”: “XCUITest”,

[debug] [XCUITestDriver@145d] “appium:deviceName”: “iPhone 8”,

[debug] [XCUITestDriver@145d] “appium:platformVersion”: “16.4”,

[debug] [XCUITestDriver@145d] “appium:udid”: “040B6527-7F82-4F42-A78E-CE92DBA6D7D7”,

[debug] [XCUITestDriver@145d] “appium:includeSafariInWebviews”: true,

[debug] [XCUITestDriver@145d] “appium:newCommandTimeout”: 3600,

[debug] [XCUITestDriver@145d] “appium:connectHardwareKeyboard”: true

[debug] [XCUITestDriver@145d] },

[debug] [XCUITestDriver@145d] “firstMatch”: [

[debug] [XCUITestDriver@145d] {}

[debug] [XCUITestDriver@145d] ]

[debug] [XCUITestDriver@145d] }

[XCUITestDriver@145d (aa4ab374)] Session created with session id: aa4ab374-4789-48e3-99e0-ffffd651c4ad

[debug] [XCUITest] Current user: ‘nifargo’

[debug] [XCUITestDriver@145d (aa4ab374)] Available devices: 00008101-000359A90EA1001E

[debug] [XCUITestDriver@145d (aa4ab374)] No real device with udid ‘040B6527-7F82-4F42-A78E-CE92DBA6D7D7’. Looking for simulator

[iOSSim] Constructing iOS simulator for Xcode version 14.3.1 with udid ‘040B6527-7F82-4F42-A78E-CE92DBA6D7D7’

[XCUITestDriver@145d (aa4ab374)] Determining device to run tests on: udid: ‘040B6527-7F82-4F42-A78E-CE92DBA6D7D7’, real device: false

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘xcodeDetailsRetrieved’ logged at 1692609021669 (11:10:21 GMT+0200 (Central European Summer Time))

[BaseDriver] Using local app ‘/Users/nifargo/Downloads/DKV.app’

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘appConfigured’ logged at 1692609021671 (11:10:21 GMT+0200 (Central European Summer Time))

[debug] [XCUITest] Checking whether app ‘/Users/nifargo/Downloads/DKV.app’ is actually present on file system

[debug] [XCUITest] App is present

[debug] [XCUITest] Getting bundle ID from app ‘/Users/nifargo/Downloads/DKV.app’: ‘de.dkv-preprod.finder’

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘resetStarted’ logged at 1692609021673 (11:10:21 GMT+0200 (Central European Summer Time))

[debug] [simctl] Error running ‘terminate’: An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):

Unable to lookup in current state: Shutdown

[XCUITest] Reset: failed to terminate Simulator application with id “de.dkv-preprod.finder”

[XCUITest] Not scrubbing third party app in anticipation of uninstall

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘resetComplete’ logged at 1692609021903 (11:10:21 GMT+0200 (Central European Summer Time))

[XCUITestDriver@145d (aa4ab374)] Using WDA path: ‘/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent’

[XCUITestDriver@145d (aa4ab374)] Using WDA agent: ‘/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj’

[XCUITest] Continuing without capturing device logs: iOS Simulator with udid ‘040B6527-7F82-4F42-A78E-CE92DBA6D7D7’ is not running

[XCUITestDriver@145d (aa4ab374)] Setting up simulator

[debug] [iOSSim] Setting preferences of 040B6527-7F82-4F42-A78E-CE92DBA6D7D7 Simulator to {“ConnectHardwareKeyboard”:true}

[debug] [iOSSim] Setting common Simulator preferences to {“RotateWindowWhenSignaledByGuest”:true,“StartLastDeviceOnLaunch”:false,“DetachOnWindowClose”:false,“AttachBootedOnStart”:true,“ConnectHardwareKeyboard”:true,“PasteboardAutomaticSync”:false}

[debug] [iOSSim] Updated 040B6527-7F82-4F42-A78E-CE92DBA6D7D7 Simulator preferences at ‘/Users/nifargo/Library/Preferences/com.apple.iphonesimulator.plist’ with {“RotateWindowWhenSignaledByGuest”:true,“StartLastDeviceOnLaunch”:false,“DetachOnWindowClose”:false,“AttachBootedOnStart”:true,“ConnectHardwareKeyboard”:true,“PasteboardAutomaticSync”:false,“DevicePreferences”:{“040B6527-7F82-4F42-A78E-CE92DBA6D7D7”:{“ConnectHardwareKeyboard”:true,“SimulatorExternalDisplay”:2114,“SimulatorWindowGeometry”:{“898CD444-7AEE-46D1-A60B-1542F8FA4624”:{“WindowCenter”:"{755.5, 511}",“WindowScale”:0.8886389201349831}},“SimulatorWindowOrientation”:“Portrait”,“SimulatorWindowRotationAngle”:0,“ChromeTint”:""}}}

[iOSSim] Starting Simulator UI: open -Fn /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app

[debug] [XCUITestDriver@145d (aa4ab374)] Parsed BUILD_DIR configuration value: ‘/Users/nifargo/Library/Developer/Xcode/DerivedData/WebDriverAgent-csdmytlpaujgvtaucifrtxngagmh/Build/Products’

[debug] [XCUITestDriver@145d (aa4ab374)] Got derived data root: ‘/Users/nifargo/Library/Developer/Xcode/DerivedData/WebDriverAgent-csdmytlpaujgvtaucifrtxngagmh’

[iOSSim] Simulator with UDID 040B6527-7F82-4F42-A78E-CE92DBA6D7D7 booted in 15.938s

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘simStarted’ logged at 1692609038592 (11:10:38 GMT+0200 (Central European Summer Time))

[debug] [IOSSimulatorLog] Starting log capture for iOS Simulator with udid ‘040B6527-7F82-4F42-A78E-CE92DBA6D7D7’ using simctl

[debug] [XCUITestDriver@145d (aa4ab374)] Event ‘logCaptureStarted’ logged at 1692609040179 (11:10:40 GMT+0200 (Central European Summer Time))

[debug] [XCUITest] Verifying application platform

[debug] [XCUITest] CFBundleSupportedPlatforms: [“iPhoneOS”]

[XCUITestDriver@145d (aa4ab374)] {}

[DevCon Factory] Releasing connections for 040B6527-7F82-4F42-A78E-CE92DBA6D7D7 device on any port number

[DevCon Factory] No cached connections have been found

[debug] [XCUITestDriver@145d (aa4ab374)] Not clearing log files. Use clearSystemFiles capability to turn on.

[debug] [IOSSimulatorLog] Stopping iOS log capture

[debug] [AppiumDriver@e4d1] Event ‘newSessionStarted’ logged at 1692609040190 (11:10:40 GMT+0200 (Central European Summer Time))

[debug] [AppiumDriver@e4d1] Encountered internal error running command: Error: Simulator architecture is unsupported by the ‘/Users/nifargo/Downloads/DKV.app’ application. Make sure the correct deployment target has been selected for its compilation in Xcode.

[debug] [AppiumDriver@e4d1] at XCUITestDriver.verifyApplicationPlatform (/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/lib/app-utils.js:105:11)

[debug] [AppiumDriver@e4d1] at XCUITestDriver.installAUT (/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:1685:5)

[debug] [AppiumDriver@e4d1] at XCUITestDriver.start (/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:661:5)

[debug] [AppiumDriver@e4d1] at XCUITestDriver.createSession (/Users/nifargo/.appium/node_modules/appium-xcuitest-driver/lib/driver.js:404:7)

[debug] [AppiumDriver@e4d1] at AppiumDriver.createSession (/usr/local/lib/node_modules/appium/lib/appium.js:346:35)

[HTTP] <-- POST /session 500 19133 ms - 860

[HTTP]

Send this to dev to check

I think this is the key to the problem right here. If Dev is building for Intel Simulator, it won’t work for M1. Solutions would include trying to run this app on Intel Simulator, and asking Dev to build for M1 Simulator. Here are some articles that may help:

i sent it and he said that he doesnt know what to do. Cause our build works in apple store. So what should he change to use this build in appium inspector for simulators?

thx we will try
and ill update this topic

in AppStore works REAL device build NOT simulator.
ask developer how your DVK.app was build?


Developer should use option Any iOS Simulator Device (arm64, x86_64).

he picked Any IOS device - cause if he pick Any IOS Simulator device - he cant create a build
i mean he cant click Product -> Archive. cause the Archive line is inactive

this is IPA fail for REAL devices only!

Try to build APP file for some selected simulator maybe and use it.

I faced similar issue. I wasn’t able to inspect the app in inspector. So I updated the webDriverAgent in my mac air m1. It can be dowloaded from here https://github.com/appium/WebDriverAgent/releases/tag/v4.9.0. Once downloaded, unzip and replace it with appium-webdriveragent folder which is already in the machine. Remember, when you replace the folder- rename the folder to appium-webdriveragent as appium inspector and appium GUI will look for this name
Then open the webdriveragent.xcodproj file inside that folder and make the necessary changes like provisining profile, bundleId in build settings of WebDriverAgentLib and WebDriverAgentRunner. Making these changes worked for me.
Additionally look at the Apple Developer forums for issues if possible. Look at this forum post: https://developer.apple.com/forums/thread/712039

1 Like

The main problem that i found how to set up the IOS project How to Seamlessly Integrate Appium with Xcode Simulator for iOS Testing | by Wavda Aniva | Medium. and in the end of the topic i found the IOS app build - and this one i can open with inspector but dont understand why i cant do the same with our own build file) but ill try your solution

the fact is if we select some other simulator - we cant click Archive button as well. So that is why i don’t understand why i cant create a build for simulator at all?

So the problem is - we use the not correct build for inspector? And the problem not in the inspector settings but in the IOS build that we use for it?
Cause our app exist in the app store and it works perfectly.

Okay could you please tell me more about the changes in build settings of WebDriverAgentLib and WebDriverAgentRunner?
cause i add Team and create my own Bundle identifier but dont see the checkbox - use IOS Bundle identifier

That all what should i do? cause after that it doesnt work for me and i got the same error in the Appium inspector as i got before

You want to run app on Simulator while it build for real phone. This is not work. Problem not in Appium. You can try manually install build you have on simulator - it should same fail to install.

1 Like