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

**URL:** <https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680>\
**Category:** Mobile Testing\
**Tags:** mobile-testing, katalon-studio\
**Created:** [January 17, 2022, 12:49pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680 "2022-01-17T12:49:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thomi/32/19031_2.png) [@thomi](https://forum.katalon.com/u/thomi)\
**Post date:** [January 17, 2022, 12:49pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/1 "2022-01-17T12:49:47Z")

</div>

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](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](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)

 ![Screen Shot 2022-01-17 at 17.52.26](https://europe1.discourse-cdn.com/katalon/original/3X/9/9/99c476e281516f4a60e9c03117bdee11e58ea0a7.jpeg)

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

 ![Screen Shot 2022-01-17 at 19.34.11](https://europe1.discourse-cdn.com/katalon/original/3X/f/3/f3ac7b65fba889b70ad14bbb13c7c8022e0a698f.jpeg)

> 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 [https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md](https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md). 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?

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [January 17, 2022, 12:53pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/2 "2022-01-17T12:53:25Z")

</div>

@thomi,

You can manually follow our document to setup iOS dependencies for Mobile test:  
[[Mobile] iOS Setup | Katalon Docs](https://docs.katalon.com/katalon-studio/tutorials/mobile-ios-setup.html#part-1-setting-up-the-environment-for-ios-testing)  
[Install WebDriverAgent for iOS devices | Katalon Docs](https://docs.katalon.com/katalon-studio/docs/installing-webdriveragent-for-ios-devices.html#setting-up-the-ios-device)

> **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](https://www.youtube.com/watch?v=LHfCob8SVCQ)

---

<div class="post-metadata">

**Author:** ![thomi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thomi/32/19031_2.png) [@thomi](https://forum.katalon.com/u/thomi)\
**Post date:** [January 17, 2022, 1:13pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/3 "2022-01-17T13:13:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [January 17, 2022, 1:19pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/4 "2022-01-17T13:19:54Z")

</div>

@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

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

```

Now you cd to:

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

```

---

<div class="post-metadata">

**Author:** ![thomi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thomi/32/19031_2.png) [@thomi](https://forum.katalon.com/u/thomi)\
**Post date:** [January 17, 2022, 2:41pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/5 "2022-01-17T14:41:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [January 17, 2022, 2:47pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/6 "2022-01-17T14:47:09Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![thomi](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thomi/32/19031_2.png) [@thomi](https://forum.katalon.com/u/thomi)\
**Post date:** [January 17, 2022, 3:04pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/7 "2022-01-17T15:04:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [January 17, 2022, 3:42pm UTC](https://forum.katalon.com/t/cant-run-mobile-record-mobile-spy-on-the-ios-simulator-or-real-ios-device-mac-m1-code-65/61680/8 "2022-01-17T15:42:23Z")

</div>

> 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.
