appium-ios-simulator
Advanced tools
Comparing version 3.27.2 to 3.28.0
@@ -9,3 +9,3 @@ "use strict"; | ||
exports.toXmlArg = toXmlArg; | ||
exports.generateUpdateCommandArgs = generateUpdateCommandArgs; | ||
exports.generateDefaultsCommandArgs = generateDefaultsCommandArgs; | ||
exports.NSUserDefaults = void 0; | ||
@@ -65,3 +65,3 @@ | ||
function generateUpdateCommandArgs(valuesMap) { | ||
function generateDefaultsCommandArgs(valuesMap, replace = false) { | ||
const resultArgs = []; | ||
@@ -71,3 +71,3 @@ | ||
try { | ||
if (_lodash.default.isPlainObject(value)) { | ||
if (!replace && _lodash.default.isPlainObject(value)) { | ||
const dictArgs = [key, '-dict-add']; | ||
@@ -80,6 +80,6 @@ | ||
resultArgs.push(dictArgs); | ||
} else if (_lodash.default.isArray(value)) { | ||
} else if (!replace && _lodash.default.isArray(value)) { | ||
const arrayArgs = [key, '-array-add']; | ||
for (const subValue of arrayArgs) { | ||
for (const subValue of value) { | ||
arrayArgs.push(toXmlArg(subValue)); | ||
@@ -129,3 +129,3 @@ } | ||
const commandArgs = generateUpdateCommandArgs(valuesMap); | ||
const commandArgs = generateDefaultsCommandArgs(valuesMap); | ||
@@ -144,2 +144,2 @@ try { | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9kZWZhdWx0cy11dGlscy5qcyJdLCJuYW1lcyI6WyJ0b1htbEFyZyIsInZhbHVlIiwic2VyaWFsaXplIiwieG1sRG9jIiwiXyIsImlzUGxhaW5PYmplY3QiLCJET01QYXJzZXIiLCJwYXJzZUZyb21TdHJpbmciLCJzdWJLZXkiLCJzdWJWYWx1ZSIsInRvUGFpcnMiLCJrZXlFbCIsImNyZWF0ZUVsZW1lbnQiLCJrZXlUZXh0RWwiLCJjcmVhdGVUZXh0Tm9kZSIsImFwcGVuZENoaWxkIiwiZG9jdW1lbnRFbGVtZW50Iiwic3ViVmFsdWVFbCIsImltcG9ydE5v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 -30,2 +30,4 @@ "use strict"; | ||
var _bluebird = _interopRequireDefault(require("bluebird")); | ||
const SIMULATOR_SHUTDOWN_TIMEOUT = 15 * 1000; | ||
@@ -358,2 +360,91 @@ const startupLock = new _asyncLock.default(); | ||
async configureLocalization(opts = {}) { | ||
if (_lodash.default.isEmpty(opts)) { | ||
return false; | ||
} | ||
const { | ||
language, | ||
locale, | ||
keyboard | ||
} = opts; | ||
const globalPrefs = {}; | ||
let keyboardId = null; | ||
if (_lodash.default.isPlainObject(keyboard)) { | ||
const { | ||
name, | ||
layout, | ||
hardware | ||
} = keyboard; | ||
if (!name) { | ||
throw new Error(`The 'keyboard' field must have a valid name set`); | ||
} | ||
if (!layout) { | ||
throw new Error(`The 'keyboard' field must have a valid layout set`); | ||
} | ||
keyboardId = `${name}@sw=${layout}`; | ||
if (hardware) { | ||
keyboardId += `;@hw=${hardware}`; | ||
} | ||
globalPrefs.AppleKeyboards = [keyboardId]; | ||
} | ||
if (_lodash.default.isPlainObject(language)) { | ||
const { | ||
name | ||
} = language; | ||
if (!name) { | ||
throw new Error(`The 'language' field must have a valid name set`); | ||
} | ||
globalPrefs.AppleLanguages = [name]; | ||
} | ||
if (_lodash.default.isPlainObject(locale)) { | ||
const { | ||
name, | ||
calendar | ||
} = locale; | ||
if (!name) { | ||
throw new Error(`The 'locale' field must have a valid name set`); | ||
} | ||
let localeId = name; | ||
if (calendar) { | ||
localeId += `@calendar=${calendar}`; | ||
} | ||
globalPrefs.AppleLocale = localeId; | ||
} | ||
if (_lodash.default.isEmpty(globalPrefs)) { | ||
return false; | ||
} | ||
const argChunks = (0, _defaultsUtils.generateDefaultsCommandArgs)(globalPrefs, true); | ||
await _bluebird.default.all(argChunks.map(args => this.simctl.spawnProcess(['defaults', 'write', '.GlobalPreferences.plist', ...args]))); | ||
if (keyboardId) { | ||
const argChunks = (0, _defaultsUtils.generateDefaultsCommandArgs)({ | ||
KeyboardsCurrentAndNext: [keyboardId], | ||
KeyboardLastUsed: keyboardId, | ||
KeyboardLastUsedForLanguage: { | ||
[keyboard.name]: keyboardId | ||
} | ||
}, true); | ||
await _bluebird.default.all(argChunks.map(args => this.simctl.spawnProcess(['defaults', 'write', 'com.apple.Preferences', ...args]))); | ||
} | ||
return true; | ||
} | ||
} | ||
@@ -365,2 +456,2 @@ | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9zaW11bGF0b3IteGNvZGUtOS5qcyJdLCJuYW1lcyI6WyJTSU1VTEFUT1JfU0hVVERPV05fVElNRU9VVCIsInN0YXJ0dXBMb2NrIiwiQXN5bmNMb2NrIiwicHJlZmVyZW5jZXNQbGlzdEd1YXJkIiwiRU5ST0xMTUVOVF9OT1RJRklDQVRJT05fUkVDRUlWRVIiLCJTaW11bGF0b3JYY29kZTkiLCJTaW11bGF0b3JYY29kZTgiLCJjb25zdHJ1Y3RvciIsInVkaWQiLCJ4Y29kZVZlcnNpb24iLCJydW4iLCJvcHRzIiwiXyIsImNsb25lRGVlcCIsImRlZmF1bHRzRGVlcCIsImRldmljZVByZWZlcmVuY2VzIiwiaXNIZWFkbGVzcyIsInN0YXJ0dXBUaW1lb3V0Iiwic2NhbGVGYWN0b3IiLCJTaW11bGF0b3JXaW5kb3dMYXN0U2NhbGUiLCJwYXJzZUZsb2F0IiwiY29tbW9uUHJlZmVyZW5jZXMiLCJSb3RhdGVXaW5kb3dXaGVuU2lnbmFsZWRCeUd1ZXN0IiwiaXNCb29sZWFuIiwiY29ubmVjdEhhcmR3YXJlS2V5Ym9hcmQiLCJpc05pbCIsIkNvbm5lY3RIYXJkd2FyZUtleWJvYXJkIiwidHJhY2VQb2ludGVyIiwiU2hvd1NpbmdsZVRvdWNoZXMiLCJTaG93UGluY2hlcyIsIlNob3dQaW5jaFBpdm90UG9pbnQiLCJIaWdobGlnaHRFZGdlR2VzdHVyZXMiLCJsb3dlckNhc2UiLCJwYXN0ZWJvYXJkQXV0b21hdGljU3luY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24gLSBTaW11bGF0b3Igd2luZG93IG9yaWVudGF0aW9uLiBQb3NzaWJsZSB2YWx1ZXMgYXJlOlxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1BvcnRyYWl0JywgJ0xhbmRzY2FwZUxlZnQnLCAnUG9ydHJhaXRVcHNpZGVEb3duJyBhbmQgJ0xhbmRzY2FwZVJpZ2h0Jy5cbiAgICogQHByb3BlcnR5IHs/bnVtYmVyfSBTaW11bGF0b3JXaW5kb3dSb3RhdGlvbkFuZ2xlIC0gV2luZG93IHJvdGF0aW9uIGFuZ2xlLiBUaGlzIHZhbHVlIGlzIGV4cGVjdGVkIHRvIGJlIGluIHN5bmNcbiAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aCBfU2ltdWxhdG9yV2luZG93T3JpZW50YXRpb25fLiBUaGUgY29ycmVzcG9uZGluZyB2YWx1ZXMgYXJlOlxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCA5MCwgMTgwIGFuZCAyNzAuXG4gICAqIEBwcm9wZXJ0eSB7P3N0cmluZ30gU2ltdWxhdG9yV2luZG93Q2VudGVyIC0gVGhlIGNvb3JkaW5hdGVzIG9mIFNpbXVsYXRvcidzIHdpbmRvdyBjZW50ZXIgaW4gcGl4ZWxzLFxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciBleGFtcGxlICd7LTEyOTQuNSwgNzc1LjV9Jy5cbiAgICogQHByb3BlcnR5IHs/Ym9vbGVhbn0gQ29ubmVjdEhhcmR3YXJlS2V5Ym9hcmQgLSBFcXVhbHMgdG8gMSBpZiBoYXJkd2FyZSBrZXlib2FyZCBzaG91bGQgYmUgY29ubmVjdGVkLlxuICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE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gcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGNvbnN0IGFyZ0NodW5rcyA9IGdlbmVyYXRlRGVmYXVsdHNDb21tYW5kQXJncyhnbG9iYWxQcmVmcywgdHJ1ZSk7XG4gICAgYXdhaXQgQi5hbGwoYXJnQ2h1bmtzLm1hcCgoYXJncykgPT4gdGhpcy5zaW1jdGwuc3Bhd25Qcm9jZXNzKFtcbiAgICAgICdkZWZhdWx0cycsICd3cml0ZScsICcuR2xvYmFsUHJlZmVyZW5jZXMucGxpc3QnLCAuLi5hcmdzXG4gICAgXSkpKTtcblxuICAgIGlmIChrZXlib2FyZElkKSB7XG4gICAgICBjb25zdCBhcmdDaHVua3MgPSBnZW5lcmF0ZURlZmF1bHRzQ29tbWFuZEFyZ3Moe1xuICAgICAgICBLZXlib2FyZHNDdXJyZW50QW5kTmV4dDogW2tleWJvYXJkSWRdLFxuICAgICAgICBLZXlib2FyZExhc3RVc2VkOiBrZXlib2FyZElkLFxuICAgICAgICBLZXlib2FyZExhc3RVc2VkRm9yTGFuZ3VhZ2U6IHsgW2tleWJvYXJkLm5hbWVdOiBrZXlib2FyZElkIH1cbiAgICAgIH0sIHRydWUpO1xuICAgICAgYXdhaXQgQi5hbGwoYXJnQ2h1bmtzLm1hcCgoYXJncykgPT4gdGhpcy5zaW1jdGwuc3Bhd25Qcm9jZXNzKFtcbiAgICAgICAgJ2RlZmF1bHRzJywgJ3dyaXRlJywgJ2NvbS5hcHBsZS5QcmVmZXJlbmNlcycsIC4uLmFyZ3NcbiAgICAgIF0pKSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRydWU7XG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBTaW11bGF0b3JYY29kZTk7XG4iXSwiZmlsZSI6ImxpYi9zaW11bGF0b3IteGNvZGUtOS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLiJ9 |
@@ -67,10 +67,13 @@ import _ from 'lodash'; | ||
* @param {Object} valuesMap Preferences mapping | ||
* @param {Boolean} replace [false] Whether to generate arguments that replace | ||
* complex typed values like arrays or dictionaries in the current plist or | ||
* update them (the default settings) | ||
* @returns {Array<Array<string>>} Each item in the array | ||
* is the `defaults write <plist>` command suffix | ||
*/ | ||
function generateUpdateCommandArgs (valuesMap) { | ||
function generateDefaultsCommandArgs (valuesMap, replace = false) { | ||
const resultArgs = []; | ||
for (const [key, value] of _.toPairs(valuesMap)) { | ||
try { | ||
if (_.isPlainObject(value)) { | ||
if (!replace && _.isPlainObject(value)) { | ||
const dictArgs = [key, '-dict-add']; | ||
@@ -81,5 +84,5 @@ for (const [subKey, subValue] of _.toPairs(value)) { | ||
resultArgs.push(dictArgs); | ||
} else if (_.isArray(value)) { | ||
} else if (!replace && _.isArray(value)) { | ||
const arrayArgs = [key, '-array-add']; | ||
for (const subValue of arrayArgs) { | ||
for (const subValue of value) { | ||
arrayArgs.push(toXmlArg(subValue)); | ||
@@ -143,3 +146,3 @@ } | ||
const commandArgs = generateUpdateCommandArgs(valuesMap); | ||
const commandArgs = generateDefaultsCommandArgs(valuesMap); | ||
try { | ||
@@ -156,3 +159,3 @@ await B.all(commandArgs.map((args) => exec('defaults', ['write', this.plist, ...args]))); | ||
NSUserDefaults, | ||
toXmlArg, generateUpdateCommandArgs, | ||
toXmlArg, generateDefaultsCommandArgs, | ||
}; |
@@ -9,3 +9,4 @@ import SimulatorXcode8 from './simulator-xcode-8'; | ||
import { toBiometricDomainComponent, getDeveloperRoot } from './utils.js'; | ||
import { NSUserDefaults } from './defaults-utils'; | ||
import { NSUserDefaults, generateDefaultsCommandArgs } from './defaults-utils'; | ||
import B from 'bluebird'; | ||
@@ -418,4 +419,99 @@ const SIMULATOR_SHUTDOWN_TIMEOUT = 15 * 1000; | ||
/** | ||
* @typedef {Object} KeyboardOptions | ||
* @property {!string} name The name of the keyboard locale, for example `en_US` or `de_CH` | ||
* @property {!string} layout The keyboard layout, for example `QUERTY` or `Ukrainian` | ||
* @property {?string} hardware Could either be `Automatic` or `null` | ||
*/ | ||
/** | ||
* @typedef {Object} LanguageOptions | ||
* @property {!string} name The name of the language, for example `de` or `zh-Hant-CN` | ||
*/ | ||
/** | ||
* @typedef {Object} LocaleOptions | ||
* @property {!string} name The name of the system locale, for example `de_CH` or `zh_CN` | ||
* @property {?string} calendar Optional calendar format, for example `gregorian` or `persian` | ||
*/ | ||
/** | ||
* @typedef {Object} LocalizationOptions | ||
* @property {?KeyboardOptions} keyboard | ||
* @property {?LanguageOptions} language | ||
* @property {?LocaleOptions} locale | ||
*/ | ||
/** | ||
* Change localization settings on the currently booted simulator | ||
* | ||
* @param {?LocalizationOptions} opts | ||
* @throws {Error} If there was a failure while setting the preferences | ||
* @returns {boolean} `true` if any of settings has been successfully changed | ||
*/ | ||
async configureLocalization (opts = {}) { | ||
if (_.isEmpty(opts)) { | ||
return false; | ||
} | ||
const { language, locale, keyboard } = opts; | ||
const globalPrefs = {}; | ||
let keyboardId = null; | ||
if (_.isPlainObject(keyboard)) { | ||
const { name, layout, hardware } = keyboard; | ||
if (!name) { | ||
throw new Error(`The 'keyboard' field must have a valid name set`); | ||
} | ||
if (!layout) { | ||
throw new Error(`The 'keyboard' field must have a valid layout set`); | ||
} | ||
keyboardId = `${name}@sw=${layout}`; | ||
if (hardware) { | ||
keyboardId += `;@hw=${hardware}`; | ||
} | ||
globalPrefs.AppleKeyboards = [keyboardId]; | ||
} | ||
if (_.isPlainObject(language)) { | ||
const { name } = language; | ||
if (!name) { | ||
throw new Error(`The 'language' field must have a valid name set`); | ||
} | ||
globalPrefs.AppleLanguages = [name]; | ||
} | ||
if (_.isPlainObject(locale)) { | ||
const { name, calendar } = locale; | ||
if (!name) { | ||
throw new Error(`The 'locale' field must have a valid name set`); | ||
} | ||
let localeId = name; | ||
if (calendar) { | ||
localeId += `@calendar=${calendar}`; | ||
} | ||
globalPrefs.AppleLocale = localeId; | ||
} | ||
if (_.isEmpty(globalPrefs)) { | ||
return false; | ||
} | ||
const argChunks = generateDefaultsCommandArgs(globalPrefs, true); | ||
await B.all(argChunks.map((args) => this.simctl.spawnProcess([ | ||
'defaults', 'write', '.GlobalPreferences.plist', ...args | ||
]))); | ||
if (keyboardId) { | ||
const argChunks = generateDefaultsCommandArgs({ | ||
KeyboardsCurrentAndNext: [keyboardId], | ||
KeyboardLastUsed: keyboardId, | ||
KeyboardLastUsedForLanguage: { [keyboard.name]: keyboardId } | ||
}, true); | ||
await B.all(argChunks.map((args) => this.simctl.spawnProcess([ | ||
'defaults', 'write', 'com.apple.Preferences', ...args | ||
]))); | ||
} | ||
return true; | ||
} | ||
} | ||
export default SimulatorXcode9; |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "3.27.2", | ||
"version": "3.28.0", | ||
"author": "appium", | ||
@@ -70,3 +70,3 @@ "license": "Apache-2.0", | ||
"eslint-config-appium": "^4.0.1", | ||
"fs-extra": "^9.0.0", | ||
"fs-extra": "^10.0.0", | ||
"gulp": "^4.0.0", | ||
@@ -73,0 +73,0 @@ "ios-test-app": "^3.0.0", |
637747
8239