Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 19C5E200B20 for ; Wed, 11 May 2016 20:30:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 185C2160A18; Wed, 11 May 2016 18:30:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 629DB160A17 for ; Wed, 11 May 2016 20:30:11 +0200 (CEST) Received: (qmail 38968 invoked by uid 500); 11 May 2016 18:30:10 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 38843 invoked by uid 99); 11 May 2016 18:30:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 18:30:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D5C89DFC71; Wed, 11 May 2016 18:30:09 +0000 (UTC) From: sarangan12 To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-paramedic pull request: Choose Target and use it for loggi... Content-Type: text/plain Message-Id: <20160511183009.D5C89DFC71@git1-us-west.apache.org> Date: Wed, 11 May 2016 18:30:09 +0000 (UTC) archived-at: Wed, 11 May 2016 18:30:12 -0000 Github user sarangan12 commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/5#discussion_r62901242 --- Diff: lib/ParamedicTargetChooser.js --- @@ -0,0 +1,127 @@ +var Q = require('q'); +var shelljs = require('shelljs'); +var path = require("path-extra"); +var logger = require('./utils').logger; +var util = require('./utils').utilities; +var spawn = require('child_process').spawn; +var ParamedicKill = require('./ParamedicKill'); + +var ANDROID_RETRY_TIMES = 3; +var ANDROID_TIME_OUT = 300000; //5 Minutes + +function ParamedicTargetChooser(appPath, platform) { + this.appPath = appPath; + this.platform = platform; +} + +ParamedicTargetChooser.prototype.chooseTarget = function(emulator) { + var targetObj = ""; + switch(this.platform) { + case util.ANDROID: + targetObj = this.chooseTargetForAndroid(emulator); + break; + case util.IOS: + targetObj = this.chooseTargetForIOS(emulator); + break; + case util.WINDOWS: + targetObj = this.chooseTargetForWindows(emulator); + break; + default: + break; + } + return targetObj; +} + +ParamedicTargetChooser.prototype.chooseTargetForAndroid = function(emulator) { + logger.info("cordova-paramedic: Choosing Target for Android"); + var self = this; + return this.startAnAndroidEmulator().then(function(){ + var obj = {}; + obj.target = self.getRunningDeviceForAndroid(); --- End diff -- Good catch.. Changed the logic to use the same id. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org