The problem was resolved, when I changed the PATH in run-slave.sh file in jenkins folder to following:
export ANDROID_HOME=~/Library/Android/sdk
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-18.0.2.jdk/Contents/Home
export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/build_tools:/Applications/Xcode.app/Contents/Developer/usr/bin:$JAVA_HOME/bin:/usr/local/lib:/bin:/usr/local/bin:/usr/bin:$PATH