Azure DevOps with iOS test

I’m using Azure DevOps to run the Katalon Sample ios Project.
When running the Katalon Task, getting error:
Failed to start ios_webkit_debug_proxy on default port 27753
:x: Unable to start app at: ‘/Users/runner/work/1/s/App/Coffee Timer.app’ (Root cause: com.kms.katalon.core.appium.exception.AppiumStartException: Appium directory is invalid: Cannot find appium executable file.

Is there any part I missed to do?
Any ideas to fix this?
Really thanks for any suggestions.

pool:
demands: xcode
vmImage: ‘macOS-12’

This is the appium install log:


info AppiumDoctor  ✔ The Node.js binary was found at: /Users/runner/hostedtoolcache/node/14.20.0/x64/bin/node
info AppiumDoctor  ✔ Node version is 14.20.0
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode_13.4.1.app/Contents/Developer
info AppiumDoctor  ✔ Xcode Command Line Tools are installed in: /Applications/Xcode_13.4.1.app/Contents/Developer
info AppiumDoctor  ✔ DevToolsSecurity is enabled.
info AppiumDoctor  ✔ The Authorization DB is set up properly.
info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage. Installed version is: 0.38.0
info AppiumDoctor  ✔ HOME is set to: /Users/runner
info AppiumDoctor ### Diagnostic for necessary dependencies completed, no fix needed. ###
info AppiumDoctor 
info AppiumDoctor ### Diagnostic for optional dependencies starting ###
WARN AppiumDoctor  ✖ opencv4nodejs cannot be found.
WARN AppiumDoctor  ✖ ffmpeg cannot be found
WARN AppiumDoctor  ✖ mjpeg-consumer cannot be found.
WARN AppiumDoctor  ✖ set-simulator-location is not installed
WARN AppiumDoctor  ✖ idb and idb_companion are not installed
WARN AppiumDoctor  ✖ applesimutils cannot be found
WARN AppiumDoctor  ✖ ios-deploy cannot be found
info AppiumDoctor ### Diagnostic for optional dependencies completed, 7 fixes possible. ###
info AppiumDoctor 
info AppiumDoctor ### Optional Manual Fixes ###
info AppiumDoctor The configuration can install optionally. Please do the following manually:
WARN AppiumDoctor  ➜ Why opencv4nodejs is needed and how to install it: https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/image-comparison.md
WARN AppiumDoctor  ➜ ffmpeg is needed to record screen features. Please read https://www.ffmpeg.org/ to install it
WARN AppiumDoctor  ➜ mjpeg-consumer module is required to use MJPEG-over-HTTP features. Please install it with 'npm i -g mjpeg-consumer'.
WARN AppiumDoctor  ➜ set-simulator-location is needed to set location for Simulator. Please read https://github.com/lyft/set-simulator-location to install it
WARN AppiumDoctor  ➜ Why idb is needed and how to install it: https://github.com/appium/appium-idb
WARN AppiumDoctor  ➜ Why applesimutils is needed and how to install it: http://appium.io/docs/en/drivers/ios-xcuitest/
WARN AppiumDoctor  ➜ ios-deploy is used as a fallback command to install iOS applications to real device. Please read https://github.com/ios-control/ios-deploy/ to install it
info AppiumDoctor 
info AppiumDoctor ###

This is the Katalon Task Log:

2022-07-26T10:34:55.7575260Z version:  8.2.5
2022-07-26T10:34:55.7578850Z location:  undefined
2022-07-26T10:34:55.7608520Z execute:  -retry=0 -testSuitePath="Test Suites/Smoke Tests" -browserType="iOS" -deviceId="*****************" -executionProfile="default" -apiKey="******************" --config -webui.autoUpdateDrivers=true
2022-07-26T10:35:33.4491230Z Katalon workspace folder is set to default location: /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/session-d74d76d6
2022-07-26T10:35:33.4561840Z 
2022-07-26T10:35:33.6839340Z Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
2022-07-26T10:35:36.6624300Z INFO: Katalon Version: 8.2.5
2022-07-26T10:35:36.6654700Z INFO: Command-line arguments: -runMode=console -projectPath=/Users/runner/work/1/s/iOS Mobile Tests with Katalon Studio.prj -retry=0 -testSuitePath=Test Suites/Smoke Tests -browserType=iOS -deviceId=D211DCC7-C03F-4639-901A-C1CFB2D0B4BB -executionProfile=default -apiKey=******** --config -webui.autoUpdateDrivers=true
2022-07-26T10:35:36.6666820Z 
2022-07-26T10:35:36.6668730Z INFO: User working dir: /Users/runner/.katalon/8.2.5/Katalon_Studio_Engine_MacOS-8.2.5/Katalon Studio Engine.app/Contents/MacOS
2022-07-26T10:35:36.6694250Z INFO: User home: /Users/runner
2022-07-26T10:35:36.6714730Z INFO: Java vendor: Azul Systems, Inc.
2022-07-26T10:35:36.6716330Z INFO: Java version: 1.8.0_275
2022-07-26T10:35:36.6719770Z INFO: Local OS: Mac OS X 64bit
2022-07-26T10:35:37.5120770Z INFO: CPU load: 0%
2022-07-26T10:35:37.5233160Z INFO: Total memory: 14336 MB
2022-07-26T10:35:37.5364750Z INFO: Free memory: 3728 MB
2022-07-26T10:35:37.5365960Z Start getting machine ID on Mac
2022-07-26T10:35:37.5367210Z End getting machine ID on Mac 382b0f5185773fa0f67a8ed8056c7759
2022-07-26T10:35:37.5368470Z INFO: Machine ID: 382b0f5185773fa0f67a8ed8056c7759
2022-07-26T10:35:37.5369930Z INFO: Your environment is compatible with the Katalon Runtime Engine FLOATING license.
2022-07-26T10:35:37.5372720Z Activating...
2022-07-26T10:35:51.6450120Z Start reloading plugins...
2022-07-26T10:35:51.6559810Z 
2022-07-26T10:35:52.6445010Z Katalon version: 8.2.5
2022-07-26T10:35:52.6547530Z 
2022-07-26T10:35:52.6591290Z Plugin info URL: https://store.katalon.com/api/products/ks?appVersion=8.2.5&appType=ENGINE&licenseType=TRIAL
2022-07-26T10:35:52.6691770Z 
2022-07-26T10:35:55.6752330Z Start check license task
2022-07-26T10:35:55.6852220Z 
2022-07-26T10:35:55.6954280Z Start getting machine ID on Mac
2022-07-26T10:35:55.7055460Z 
2022-07-26T10:35:55.7759880Z End getting machine ID on Mac 382b0f5185773fa0f67a8ed8056c7759
2022-07-26T10:35:55.7861120Z 
2022-07-26T10:36:00.5139010Z INFO: KATALON_JAVA_HOME: null
2022-07-26T10:36:00.5238710Z 
2022-07-26T10:36:00.5340090Z 
2022-07-26T10:36:00.5442370Z --------------------------------------------------------------------------------
2022-07-26T10:36:00.5544640Z Test Suites/Smoke Tests - iOS - D211DCC7-C03F-4639-901A-C1CFB2D0B4BB - 20220726_
2022-07-26T10:36:00.5644600Z 103600...................................................................0/2(0%)
2022-07-26T10:36:00.5745180Z --------------------------------------------------------------------------------
2022-07-26T10:36:00.5846590Z 
2022-07-26T10:36:00.5946970Z 
2022-07-26T10:36:00.6048370Z 
2022-07-26T10:36:06.4056920Z 2022-07-26 10:36:06.380 INFO  c.k.katalon.core.main.TestSuiteExecutor  - START Test Suites/Smoke Tests
2022-07-26T10:36:06.4156170Z 
2022-07-26T10:36:06.4553950Z 2022-07-26 10:36:06.453 INFO  c.k.katalon.core.main.TestSuiteExecutor  - hostName = runner - 10.212.2.161
2022-07-26T10:36:06.4653600Z 
2022-07-26T10:36:06.4755600Z 2022-07-26 10:36:06.455 INFO  c.k.katalon.core.main.TestSuiteExecutor  - os = Mac OS X 64bit
2022-07-26T10:36:06.4831460Z 
2022-07-26T10:36:06.4932860Z 2022-07-26 10:36:06.456 INFO  c.k.katalon.core.main.TestSuiteExecutor  - hostAddress = 10.212.2.161
2022-07-26T10:36:06.5032290Z 
2022-07-26T10:36:06.5134590Z 2022-07-26 10:36:06.457 INFO  c.k.katalon.core.main.TestSuiteExecutor  - katalonVersion = 8.2.5.208
2022-07-26T10:36:06.5233780Z 
2022-07-26T10:36:06.5335110Z 
2022-07-26T10:36:07.4946470Z 2022-07-26 10:36:07.487 INFO  c.k.katalon.core.main.TestCaseExecutor   - --------------------
2022-07-26T10:36:07.5045790Z 
2022-07-26T10:36:07.5147830Z 2022-07-26 10:36:07.487 INFO  c.k.katalon.core.main.TestCaseExecutor   - START Test Cases/Verify the main list
2022-07-26T10:36:07.5247460Z 
2022-07-26T10:36:07.8139390Z 2022-07-26 10:36:07.808 DEBUG testcase.Verify the main list            - 1: sample.Common.startAppliucation()
2022-07-26T10:36:07.8216020Z 
2022-07-26T10:36:07.8289410Z 
2022-07-26T10:36:15.6207270Z 
2022-07-26T10:36:15.6222400Z --------------------------------------------------------------------------------
2022-07-26T10:36:15.6224040Z Test Suites/Smoke Tests - iOS - D211DCC7-C03F-4639-901A-C1CFB2D0B4BB - 20220726_
2022-07-26T10:36:15.6225190Z 103600...................................................................0/2(0%)
2022-07-26T10:36:15.6226610Z --------------------------------------------------------------------------------
2022-07-26T10:36:15.6227440Z 
2022-07-26T10:36:15.6228250Z 
2022-07-26T10:36:18.7957630Z 2022-07-26 10:36:18.776 WARN  c.k.k.c.a.driver.AppiumDriverManager     - Failed to start ios_webkit_debug_proxy on default port 27753
2022-07-26T10:36:18.8062480Z 
2022-07-26T10:36:20.0529900Z 2022-07-26 10:36:20.035 ERROR c.k.k.core.keyword.internal.KeywordMain  - ❌ Unable to start app at: '/Users/runner/work/1/s/App/Coffee Timer.app' (Root cause: com.kms.katalon.core.appium.exception.AppiumStartException: Appium directory is invalid: Cannot find appium executable file.
2022-07-26T10:36:20.0636310Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.findAppiumJS(AppiumDriverManager.java:387)
2022-07-26T10:36:20.0740240Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServer(AppiumDriverManager.java:302)
2022-07-26T10:36:20.0840510Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServerJS(AppiumDriverManager.java:262)
2022-07-26T10:36:20.0943340Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.startAppiumServerJS(AppiumDriverManager.java:407)
2022-07-26T10:36:20.0944600Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.ensureServicesStarted(AppiumDriverManager.java:244)
2022-07-26T10:36:20.1045590Z 	at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:473)
2022-07-26T10:36:20.1147900Z 	at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:539)
2022-07-26T10:36:20.1248800Z 	at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startMobileDriver(MobileDriverFactory.java:452)
2022-07-26T10:36:20.1351700Z 	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.doCall(StartApplicationKeyword.groovy:49)
2022-07-26T10:36:20.1452160Z 	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword$_startApplication_closure1.call(StartApplicationKeyword.groovy)
2022-07-26T10:36:20.1556010Z 	at com.kms.katalon.core.mobile.keyword.internal.MobileKeywordMain.runKeyword(MobileKeywordMain.groovy:21)
2022-07-26T10:36:20.1658170Z 	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.startApplication(StartApplicationKeyword.groovy:51)
2022-07-26T10:36:20.1759280Z 	at com.kms.katalon.core.mobile.keyword.builtin.StartApplicationKeyword.execute(StartApplicationKeyword.groovy:40)
2022-07-26T10:36:20.1860760Z 	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
2022-07-26T10:36:20.1961760Z 	at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.startApplication(MobileBuiltInKeywords.groovy:78)
2022-07-26T10:36:20.2063060Z 	at com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords$startApplication.call(Unknown Source)
2022-07-26T10:36:20.2165040Z 	at sample.Common.startAppliucation(Common.groovy:27)
2022-07-26T10:36:20.2265540Z 	at sample.Common.invokeMethod(Common.groovy)
2022-07-26T10:36:20.2371360Z 	at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
2022-07-26T10:36:20.2473470Z 	at Verify the main list.run(Verify the main list:22)
2022-07-26T10:36:20.2573640Z 	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
2022-07-26T10:36:20.2675670Z 	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
2022-07-26T10:36:20.2776130Z 	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:442)
2022-07-26T10:36:20.2878140Z 	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
2022-07-26T10:36:20.2979500Z 	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
2022-07-26T10:36:20.3082040Z 	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
2022-07-26T10:36:20.3182870Z 	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
2022-07-26T10:36:20.3284540Z 	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:202)
2022-07-26T10:36:20.3394490Z 	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:164)
2022-07-26T10:36:20.3496520Z 	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:105)
2022-07-26T10:36:20.3596740Z 	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:185)
2022-07-26T10:36:20.3698740Z 	at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
2022-07-26T10:36:20.3785440Z 	at TempTestSuite1658831760021.run(TempTestSuite1658831760021.groovy:36)
2022-07-26T10:36:20.3858000Z )
2022-07-26T10:36:20.3905000Z 
2022-07-26T10:36:20.3918690Z 2022-07-26 10:36:20.041 ERROR 

Hello! I also use Azure DevOps to run the Katalon tests.
The error says that Appium directory is invalid:

Do you run a command like the following in your yaml?

  - bash: | 
      export APPIUM_HOME=/usr/local/lib/node_modules/appium
1 Like

I added this:
export APPIUM_HOME=$(which appium)
echo “----APPIUM_HOME Path----”
echo $APPIUM_HOME
/Users/runner/hostedtoolcache/node/14.20.0/x64/bin/appium
But seems still not working

- stage: Start_Katalon
    jobs: 
      - job: StartKatalon
        steps: 
        - task: NodeTool@0
          displayName: 'Install NodeJS'
          inputs:
            versionSpec: '14.x'
        - task: CmdLine@2
          displayName: 'Install appium'
          inputs:
            script: |
              brew outdated xctool || brew upgrade xctool
              npm install -g appium
              npm install appium-doctor -g
              export APPIUM_HOME=$(which appium)
              echo "----APPIUM_HOME Path----"
              echo $APPIUM_HOME
              appium-doctor

        - task: katalonTask@1
          inputs:
            version: '8.2.5'
            executeArgs: '-retry=0 -testSuitePath="Test Suites/Smoke Tests" -browserType="iOS" -deviceId="$(DEVICE_ID)" -executionProfile="default" -apiKey="**********" --config -webui.autoUpdateDrivers=true'

How about trying to set the specific PATH according to this post first?
I have specified this path in Mac vmImage and it is working fine.

1 Like

is it
export APPIUM_HOME=/usr/local/lib/node_modules/appium. ?

Yes, that is.

no luck, same error. :smiling_face_with_tear:
Do you have the example yml?

I use this. Maybe a webdriveragent setting?

  - bash: | 
      npm install -g npm@6
      npm install -g appium@1.21
      npm ls -g appium-webdriveragent
      cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
      mkdir -p Resources/WebDriverAgent.bundle
      export APPIUM_HOME=/usr/local/lib/node_modules/appium
      echo $APPIUM_HOME
    displayName: 'appium and xcode settings'

Update: Webdriveragent seems to be missing from the simulator setup instructions now, so it may be an old setup method?

tried this

- task: CmdLine@2
          displayName: 'Install appium'
          inputs:
            script: |
              brew outdated xctool || brew upgrade xctool
              npm install -g appium
              npm install appium-doctor -g
              npm ls -g appium-webdriveragent
              cd /Users/runner/hostedtoolcache/node/14.20.0/x64/lib/node_modules/appium/node_modules/appium-webdriveragent
              mkdir -p Resources/WebDriverAgent.bundle
              export APPIUM_HOME=/Users/runner/hostedtoolcache/node/14.20.0/x64/lib/node_modules/appium
              echo $APPIUM_HOME

also getting same error :smiling_face_with_tear:

Have you tried specifying the APPIUM_HOME as mentioned earlier with this webdriveragent setting?

- task: CmdLine@2
          displayName: 'Install appium'
          inputs:
            script: |
              brew outdated xctool || brew upgrade xctool
              npm install -g appium
              npm install appium-doctor -g
              npm ls -g appium-webdriveragent
              cd /Users/runner/hostedtoolcache/node/14.20.0/x64/lib/node_modules/appium/node_modules/appium-webdriveragent
              mkdir -p Resources/WebDriverAgent.bundle
              export APPIUM_HOME=/usr/local/lib/node_modules/appium
              echo $APPIUM_HOME
1 Like

you just save my life :partying_face:

The final result

- task: CmdLine@2
          displayName: 'Install appium'
          inputs:
            script: |
              brew outdated xctool || brew upgrade xctool
              npm install -g appium
              appium -v
              npm install appium-doctor -g
              npm ls -g appium-webdriveragent
              cd /Users/runner/hostedtoolcache/node/14.20.0/x64/lib/node_modules/appium/node_modules/appium-webdriveragent
              mkdir -p Resources/WebDriverAgent.bundle
              export APPIUM_HOME=/Users/runner/hostedtoolcache/node/14.20.0/x64/lib/node_modules/appium
              echo "##vso[task.setvariable variable=APPIUM_HOME]$APPIUM_HOME"
              echo $APPIUM_HOME
1 Like