mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 17:10:15 +08:00
CB-8834 Don't fail to install on VERSION_DOWNGRADE
This commit is contained in:
parent
84274b4259
commit
b63a2e37be
2
bin/templates/cordova/lib/device.js
vendored
2
bin/templates/cordova/lib/device.js
vendored
@ -98,7 +98,7 @@ module.exports.install = function(target, buildResults) {
|
|||||||
var launchName = appinfo.getActivityName();
|
var launchName = appinfo.getActivityName();
|
||||||
console.log('Using apk: ' + apk_path);
|
console.log('Using apk: ' + apk_path);
|
||||||
console.log('Installing app on device...');
|
console.log('Installing app on device...');
|
||||||
var cmd = 'adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"';
|
var cmd = 'adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"';
|
||||||
return exec(cmd, os.tmpdir())
|
return exec(cmd, os.tmpdir())
|
||||||
.then(function(output) {
|
.then(function(output) {
|
||||||
if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
|
if (output.match(/Failure/)) return Q.reject('ERROR: Failed to install apk to device: ' + output);
|
||||||
|
2
bin/templates/cordova/lib/emulator.js
vendored
2
bin/templates/cordova/lib/emulator.js
vendored
@ -308,7 +308,7 @@ module.exports.install = function(target, buildResults) {
|
|||||||
var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
|
var apk_path = build.findBestApkForArchitecture(buildResults, resolvedTarget.arch);
|
||||||
console.log('Installing app on emulator...');
|
console.log('Installing app on emulator...');
|
||||||
console.log('Using apk: ' + apk_path);
|
console.log('Using apk: ' + apk_path);
|
||||||
return exec('adb -s ' + resolvedTarget.target + ' install -r "' + apk_path + '"', os.tmpdir())
|
return exec('adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"', os.tmpdir())
|
||||||
.then(function(output) {
|
.then(function(output) {
|
||||||
if (output.match(/Failure/)) {
|
if (output.match(/Failure/)) {
|
||||||
return Q.reject('Failed to install apk to emulator: ' + output);
|
return Q.reject('Failed to install apk to emulator: ' + output);
|
||||||
|
Loading…
Reference in New Issue
Block a user