appium-adb
Version:
Android Debug Bridge interface
39 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildInstallArgs = buildInstallArgs;
const support_1 = require("@appium/support");
const logger_1 = require("../../logger");
/**
* Builds command-line arguments for `adb install`.
*
* @param apiLevel - Android API level of the target device
* @param options - Install options mapped to adb flags
* @returns A list of install flags
*/
function buildInstallArgs(apiLevel, options = {}) {
const result = [];
if (!support_1.util.hasValue(options.replace) || options.replace) {
result.push('-r');
}
if (options.allowTestPackages) {
result.push('-t');
}
if (options.useSdcard) {
result.push('-s');
}
if (options.grantPermissions) {
if (apiLevel < 23) {
logger_1.log.debug(`Skipping permissions grant option, since ` +
`the current API level ${apiLevel} does not support applications ` +
`permissions customization`);
}
else {
result.push('-g');
}
}
if (options.partialInstall) {
result.push('-p');
}
return result;
}
//# sourceMappingURL=install.js.map