Way to automatically install or change webdriver of appium for different devices

So I have this problem were I’m using a mobile browser to automate a website. However if I change my mobile device it requires a specific chromedriver to be install for appium. I was thinking of other way to automatically change the appium chromedriver corresponding on their mobile devices so they can also run my automation scripts ;(

@wanda

import com.kms.katalon.core.configuration.RunConfiguration

RunConfiguration.setMobileDriverPreferencesProperty("chromedriverExecutable", 'path to chromedriver executable')
WebUI.openBrowser('')

Recommended solution:

import com.kms.katalon.core.configuration.RunConfiguration

RunConfiguration.setMobileDriverPreferencesProperty("chromedriverExecutableDir", 'path to chromedriver directory')
RunConfiguration.setMobileDriverPreferencesProperty("chromedriverChromeMappingFile", 'path to the chromedriver mapping file')
WebUI.openBrowser('')

How to define mapping file: https://appium.readthedocs.io/en/latest/en/writing-running-appium/web/chromedriver/#automatic-discovery-of-compatible-chromedriver