function setConfig(deviceType, configType = 'aliased') {
    const mixins = {
      bootArgs: { bootArgs: '--someArg' },
      forceAdbInstall: { forceAdbInstall: false },
      utilBinaryPaths: { utilBinaryPaths: ['/path/to/apk'] },
      iosDevice: {
        device: {
          type: 'iPhone 7 Plus',
          os: 'iOS 10.2',
        },
      },
    };

    const deviceTemplates = {
      'ios.simulator': {
        type: 'ios.simulator',
        ...mixins.iosDevice,
        ...mixins.bootArgs,
      },
      'android.attached': {
        type: 'android.attached',
        device: { adbName: 'emulator-5554' },
        ...mixins.utilBinaryPaths,
        ...mixins.forceAdbInstall,
      },
      'android.emulator': {
        type: 'android.emulator',
        device: { avdName: 'Pixel_API_28' },
        gpu: 'auto',
        headless: true,
        readonly: true,
        ...mixins.bootArgs,
        ...mixins.utilBinaryPaths,
        ...mixins.forceAdbInstall,
      },
      'android.genycloud': {
        type: 'android.genycloud',
        device: { recipeName: 'myRecipe' },
        ...mixins.utilBinaryPaths,
        ...mixins.forceAdbInstall,
      },
      './customDriver': {
        type: './customDriver',
        device: 'firefox',
        binaryPath: 'https://example.com',
      },
    };

    const deviceId = _.uniqueId('device');
    deviceConfig = _.cloneDeep(deviceTemplates[deviceType] || deviceTemplates[undefined]);

    switch (configType) {
      case 'inline':
        localConfig.device = deviceConfig;
        break;
      case 'aliased':
        localConfig.device = deviceId;
        globalConfig.devices = { [deviceId]: deviceConfig };
        break;
    }
 }
@param {'ios.simulator' | 'android.attached' | 'android.emulator' | 'android.genycloud' | './customDriver'} deviceType
@param {'inline' | 'aliased' } configType