CB-3445: Allow build and run scripts to select APK by architecture

This commit is contained in:
Ian Clelland 2014-08-29 16:00:13 -04:00
parent 623b2306ca
commit 0b6b068097
2 changed files with 8 additions and 3 deletions

View File

@ -342,9 +342,9 @@ module.exports.run = function(options) {
* the script will error out. (should we error or just return undefined?)
* This is called by the run script to install the apk to the device
*/
module.exports.get_apk = function(build_type) {
module.exports.get_apk = function(build_type, architecture) {
var outputDir = path.join(ROOT, 'out');
var candidates = find_files(outputDir, function() { return true; });
var candidates = find_files(outputDir, function(filename) { return (!architecture) || filename.indexOf(architecture) >= 0; });
if (candidates.length === 0) {
console.error('ERROR : No .apk found in ' + outputDir + ' directory');
process.exit(2);

View File

@ -61,7 +61,12 @@ module.exports.install = function(target) {
if (device_list.indexOf(target) < 0)
return Q.reject('ERROR: Unable to find target \'' + target + '\'.');
var apk_path = build.get_apk();
var apk_path;
if (typeof process.env.DEPLOY_APK_ARCH == 'undefined') {
apk_path = build.get_apk();
} else {
apk_path = build.get_apk(null, process.env.DEPLOY_APK_ARCH);
}
launchName = appinfo.getActivityName();
console.log('Installing app on device...');
var cmd = 'adb -s ' + target + ' install -r "' + apk_path + '"';