How to pass appiumhome to appium?

set up appium on PC1, it all works well.

then copy the appium and appiumhome( /Users/user1/.appium) to PC2.

appium -> /Users/user2/appium2
appiumhome -> /Users/user2/appiumhome

workdir is /Users/user2/, using node appium2/build/lib/main.js to start appium, it will still look a driver installed at /Users/user1/.appium/node_modules/appium-xcuitest-driver.

using APPIUM_HOME=./appiumhome node appium2/build/lib/main.js, the error is the same.

checking from source code, it seems that appiumHome can pass to main method, the questing is how to do that in command line?

async function init(args) {
  const appiumHome = args?.appiumHome ?? (await resolveAppiumHome());
  let appiumHomeSourceName = 'autodetected appium home path';
  if (!_.isNil(args?.appiumHome)) {
    appiumHomeSourceName = 'appiumHome config value';
  } else if (process.env.APPIUM_HOME) {
    appiumHomeSourceName = 'APPIUM_HOME environment variable';

Recommend you just install as normal instead of spending time on this:

How to install server/drivers: