This is an automated email from the ASF dual-hosted git repository. alsorokin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-paramedic.git
The following commit(s) were added to refs/heads/master by this push: new e43017c Updated Android apk path e43017c is described below commit e43017c23647eb136d5b2f97f3321ea48908722b Author: Alexander Sorokin <v-als...@microsoft.com> AuthorDate: Tue Jan 9 10:06:49 2018 +0300 Updated Android apk path --- lib/appium/AppiumRunner.js | 12 ++++++++++-- lib/paramedic.js | 26 +++++++++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/appium/AppiumRunner.js b/lib/appium/AppiumRunner.js index dca23a4..1204cb0 100644 --- a/lib/appium/AppiumRunner.js +++ b/lib/appium/AppiumRunner.js @@ -75,8 +75,16 @@ function getPackagePath(options) { switch (options.platform) { case 'android': - var packagePath = path.join(fullAppPath, '/platforms/android/build/outputs/apk/android-debug.apk'); - if (fs.existsSync(packagePath)) { + var packagePath = null; + var maybePackagePaths = [ path.join(fullAppPath, '/platforms/android/app/build/outputs/apk/android-debug.apk'), + path.join(fullAppPath, '/platforms/android/build/outputs/apk/debug/app-debug.apk') ]; + maybePackagePaths.forEach(function (p) { + if (fs.existsSync(p)) { + packagePath = p; + return; + }; + }); + if (packagePath != null) { return packagePath; } throw new Error('Could not find apk'); diff --git a/lib/paramedic.js b/lib/paramedic.js index cd22c02..24ad808 100644 --- a/lib/paramedic.js +++ b/lib/paramedic.js @@ -648,18 +648,34 @@ ParamedicRunner.prototype.uninstallApp = function () { }; ParamedicRunner.prototype.getPackageFolder = function () { - var packageFolder; + var packageDirs = this.getPackageFolders(); + var foundDir = null; + packageDirs.forEach (function (dir) { + if (fs.existsSync(dir) && fs.statSync(dir).isDirectory()) { + foundDir = dir; + return; + } + }); + if (foundDir != null) { + return foundDir; + } + throw new Error ('Couldn\'t locate a built app directory. Looked here: ' + packageDirs); +} + +ParamedicRunner.prototype.getPackageFolders = function () { + var packageFolders; switch (this.config.getPlatformId()) { case util.ANDROID: - packageFolder = path.join(this.tempFolder.name, 'platforms/android/build/outputs/apk/'); + packageFolders = [ path.join(this.tempFolder.name, 'platforms/android/app/build/outputs/apk'), + path.join(this.tempFolder.name, 'platforms/android/build/outputs/apk') ]; break; case util.IOS: - packageFolder = path.join(this.tempFolder.name, 'platforms/ios/build/emulator/'); + packageFolders = [ path.join(this.tempFolder.name, 'platforms/ios/build/emulator') ]; break; default: throw new Error('Don\t know where the package foler is for platform: ' + this.config.getPlatformId()); } - return packageFolder; + return packageFolders; }; ParamedicRunner.prototype.getPackageName = function () { @@ -697,7 +713,7 @@ ParamedicRunner.prototype.getBinaryName = function () { switch (this.config.getPlatformId()) { case util.ANDROID: shell.pushd(this.getBinaryDir()); - var apks = shell.ls('android*debug.apk'); + var apks = shell.ls('*debug.apk'); if (apks.length > 0) { binaryName = apks.reduce(function (previous, current) { // if there is any apk for x86, take it -- To stop receiving notification emails like this one, please contact ['"commits@cordova.apache.org" <commits@cordova.apache.org>']. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org