Unable to launch appium tests from jenkins but works if i run from my desktop

Unable to launch appium tests from jenkins but works if i run from my desktop. Do i need to build first using xcode in jenkins before running my tests?

When i try to run appium tests from jenkins i get the error below:

0-0] 2020-04-03T15:06:56.628Z WARN webdriver: Request failed due to An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: Command 'carthage bootstrap --platform iOS\,tvOS' exited with code 1

And this is my pipeline:

pipeline {
agent any

environment {
    APPIUM_PORT_ONE= 4723
    APPIUM_PORT_TWO= 4724
}
tools {nodejs “node”}

stages {
stage(‘Checkout App 1’) {
steps {
echo “Building…”
sh " whoami"
}
}

    stage('Checkout App 2') {
        steps {
            echo "Building.."
        }
    }

    stage('Checkout Mirror') {
        steps {
            echo "Building.."
        }
    }

    stage('Checkout End to End Tests') {
        steps {
            echo "Building.."
        }
    }

    stage('Starting Appium Servers') {
        steps {
            parallel(
                ServerOne: {
                sh "kill \$(lsof -t -i :${APPIUM_PORT_ONE}) &"
                sh "kill \$(lsof -t -i :${APPIUM_PORT_TWO}) &"
                echo "Starting Appium Server 1"
                sh 'npm install -g appium'

              },
                ServerTwo: {
                echo "Starting Appium Server 2"

              })
              }
          }

      stage('Starting End to End Tests') {
        steps {
            echo "Starting End to End Tests"
            dir("/Users/poonam/Desktop/qa-end-to-end/") { // <<------------
            sh "appium --port 4724 --address 127.0.0.1 &"
            sh "appium --port 4723 --address 127.0.0.1 &"
            sh 'npm run test.test'
            sh 'npm install selenium-standalone@latest -g'
            echo "Shutting Down Appium Servers"
            sh "kill \$(lsof -t -i :${APPIUM_PORT_ONE}) &"
            sh "kill \$(lsof -t -i :${APPIUM_PORT_TWO}) &"
        }
      }
    }

    stage('Publish Report') {
        steps {
            echo "Publishing Report"
        }
    }
    }}