Can't run mobile record / mobile spy on the iOS simulator or real iOS device - Mac M1 (code 65)

Hello,

I can’t run mobile record / mobile spy on the simulator or real device.

Operating System: macOS Monterey 12.1 (M1 apple silicon)
Katalon Studio Version: 8.2.0
Xcode version (for iOS): 13.2.1
Appium version: 1.22.2
Which appium: /opt/homebrew/bin/appium → whenever i try to install appium its always here

I try every step here:

  1. https://docs.katalon.com/katalon-studio/tutorials/mobile-ios-setup.html#part-4-install-the-webdriveragent
  2. https://docs.katalon.com/katalon-studio/docs/installing-webdriveragent-for-ios-devices.html#setting-up-the-ios-device

and even i try to install dependencies from katalon itself (tools>ios> install dependecies)

when i try to install webdriver from katalon it shows an error

Failed to run the installation step: “Installing WebDriverAgent dependencies…”.

Cannot run program “/bin/sh” (in directory “/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent”): error=2, No such file or directory

i try to manually run command line on terminal to navigate to location of webdriveragent
cd /opt/homebrew/lib/node_modules/appium/node_modules/appium-webdriveragent

but when i want to run mobile recorded / mobile spy on real device it always shows error: Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
xcodebuild error message:
. Make sure you follow the tutorial at appium-xcuitest-driver/real-device-config.md at master · appium/appium-xcuitest-driver · GitHub. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘MacBook-Air-xxxx.local’, ip: ‘fxxxxx’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_275’
Driver info: driver.version: IOSDriver

When i try to run on the simulator it shows an error

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: Simulator architecture is unsupported by the ‘/var/folders/1s/n399g3sn5d364mg3ytgfx46h0000gn/T/Katalon/Appium/Temp1642394756121/2022017-22928-1shtjhi.tloaj/xxxx.app’ application. Make sure the correct deployment target has been selected for its compilation in Xcode.

Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

System info: host: ‘MacBook-Air-xxxx.local’, ip: ‘xxxx’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_275’

Driver info: driver.version: IOSDriver

when i try to run on the simulator, the simulator shows up but then i got an error
when i try to run on the real device, the apps successfully install on the device, but when trying to install webdriveragent it will disappear then i got an error.

can someone help me figure out where is the wrong?

@thomi,

You can manually follow our document to setup iOS dependencies for Mobile test:
[Mobile] iOS Setup | Katalon Docs
Install WebDriverAgent for iOS devices | Katalon Docs

Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65

The error shows that your WebDriverAnget setup is incorrrect. Please refer the document again or follow this video tutorial: Install WebDriverAgent to work with Katalon Studio - YouTube

I try that step but when i run this command :

cd/usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent

it always error

cd: /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent: No such file or directory

i install appium from homebrew and this is my appium path : opt/homebrew/lib/node_modules/appium/node_modules

and i dont how to change appium install directory to usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent

@thomi

That means your base Appium path is opt/homebrew/lib/node_modules/appium/node_modules that is the only different with our document but the sub folder is still the same. Eg:

Instead of

cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent

Now you cd to:

cd /opt/homebrew/lib/node_modules/appium/node_modules/appium-webdriveragent

as i mention before, i try to manually run command line on terminal to navigate to location of webdriveragent
cd /opt/homebrew/lib/node_modules/appium/node_modules/appium-webdriveragent

I run as you suggest

and when i build WebDriverAgent.xcodeproj i didn’t face any problem, i success to build it.
do you have other suggestions?

@thomi

Simulator architecture is unsupported by the application. Make sure the correct deployment target has been selected for its compilation in Xcode.

What type is the application file? Is it the .ipa or the .app file?

Simulators can run with the .app file.
Real devices can run with the .ipa file.

i try real device with .ipa file and simulator with .app file

‘/var/folders/1s/n399g3sn5d364mg3ytgfx46h0000gn/T/Katalon/Appium/Temp1642394756121/2022017-22928-1shtjhi.tloaj/xxxx.app’ application.

i just censor my apps name with xxxx.app

simulator with .app file
Make sure the correct deployment target has been selected for its compilation in Xcode.

First, you need to use XCode to rebuild your app with the correct deployment target that supports the simulators version. After that, use the rebuilt app to record/run with Katalon Studio

i try real device with .ipa file
Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65

To run with real devices, you defenitely need an Appium developer account. Please try to change the XCode account then rebuild WebDriverAgent.