Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6910410B16 for ; Mon, 15 Dec 2014 23:23:37 +0000 (UTC) Received: (qmail 2214 invoked by uid 500); 15 Dec 2014 23:23:37 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 2176 invoked by uid 500); 15 Dec 2014 23:23:37 -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 2165 invoked by uid 99); 15 Dec 2014 23:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2014 23:23:36 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of muratsu@microsoft.com designates 157.56.110.107 as permitted sender) Received: from [157.56.110.107] (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.107) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Dec 2014 23:23:32 +0000 Received: from SN2PR03MB032.namprd03.prod.outlook.com (10.255.175.42) by SN2PR03MB032.namprd03.prod.outlook.com (10.255.175.42) with Microsoft SMTP Server (TLS) id 15.1.26.9; Mon, 15 Dec 2014 23:22:48 +0000 Received: from SN2PR03MB032.namprd03.prod.outlook.com ([169.254.13.77]) by SN2PR03MB032.namprd03.prod.outlook.com ([169.254.13.77]) with mapi id 15.01.0026.003; Mon, 15 Dec 2014 23:22:48 +0000 From: Murat Sutunc To: "dev@cordova.apache.org" Subject: --list argument for CLI Thread-Topic: --list argument for CLI Thread-Index: AdAYvT352rcY1tsESKmvdzxiicQP0A== Date: Mon, 15 Dec 2014 23:22:48 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:ee31::3] x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB032; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB032; x-forefront-prvs: 04267075BD x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(53754006)(199003)(41574002)(105586002)(99286002)(107886001)(107046002)(2351001)(229853001)(40100003)(106356001)(68736005)(110136001)(2501002)(16236675004)(97736003)(76576001)(21056001)(74316001)(4396001)(120916001)(50986999)(46102003)(122556002)(555904002)(92566001)(86362001)(54606007)(19300405004)(31966008)(19625215002)(102836002)(15975445007)(33656002)(101416001)(77156002)(62966003)(450100001)(20776003)(64706001)(54206007)(86612001)(19580395003)(2656002)(99396003)(87936001)(54356999)(36394004);DIR:OUT;SFP:1102;SCL:1;SRVR:SN2PR03MB032;H:SN2PR03MB032.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: multipart/alternative; boundary="_000_SN2PR03MB032196ABA4556E6DAD98744B86F0SN2PR03MB032namprd_" MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com X-Virus-Checked: Checked by ClamAV on apache.org --_000_SN2PR03MB032196ABA4556E6DAD98744B86F0SN2PR03MB032namprd_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, My name is Murat Sutunc, I'm part of the Visual Studio team @ Microsoft and= new to Cordova. I was looking at the Cordova Tooling Wiki at (https://wiki.apache.org/cordo= va/CommandLineToolingDesign) and thought it would be interesting to make so= me additions to the list-devices feature. Currently we have list-devices an= d list-emulator-images scripts for a lot of different platforms. However th= ese scripts are not easily accessible from the Cordova CLI. By introducing = an additional argument to the run or emulate command, we could show a list = of available emulators or connected devices. (I would like to deemphasize t= he fact that the command is called --list). After invoking the command, a u= ser can decide which target to use and run the app on the desired target by= using cordova run -device devicename Here's how it looks for an Android only project: C:\dev\cordova-projects\hello>cordova run --list Running command: C:\dev\cordova-projects\hello\platforms\android\cordova\ru= n.bat --list Available Android Virtual Devices: AVD_GalaxyNexus_ToolsForApacheCordova Available Android Devices: (Internally what happens here is, through run.js we will call android list = and adb devices and pipe that list to the user. Similar process with iOS to= o.) Note that in case a platform doesn't support --list flag, it'll ignore the = flag and run as if the flag is not provided. This is due to current args pa= rsing logic in platforms. Is this ok for the short term? I would hope that = more platforms would support this option in the future. Below are the pull requests for cordova-cli and cordova-android/cordova-ios= that have this functionality implemented. I would like to hear your though= ts on this design, choice of the flag and if you think this feature would b= e a valuable addition to the CLI. cordova-cli: https://github.com/apache/cordova-cli/pull/199 cordova-android: https://github.com/apache/cordova-android/pull/139 cordova-ios: https://github.com/apache/cordova-ios/pull/122 PS: My ICLA just got approved. You can also ping me anytime on #cordova, my= name on irc is muratsu. Thanks! -Murat --_000_SN2PR03MB032196ABA4556E6DAD98744B86F0SN2PR03MB032namprd_--