As a developer I have many browsers installed on my system. Today, as part of an automation I was trying to launch a Chrome tab from command prompt and had some difficulties with it.
On a clean machine with just Chrome installed if you type the following it will open a facebook tab in Chrome:
start "" chrome "facebook.com"
Since I’ve both Canary and Chrome installed, it was launching Canary instead. After spending some time investigating (and getting some help from others) the issue become clear. If you navigate to registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths, you can see an entry for chrome.exe. Since Canary is installed for Current User only, it was shadowing the Local Machine entry which is located at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe. Renaming the Current User chrome.exe to chromesxs.exe solves the problem (I love simple solutions!). Now I can launch both Chrome browsers from my command prompt.
One natural consequence of having such a big array of devices is that most of the time developers end up testing their applications on a number of different OS/Device targets. This problem is very easy to observe for Android for example:
Luckily Cordova lets us deploy to a specific device (using cordova run --target=FOO) but with so many potential targets available, sometimes it’s not so easy to figure out which device we’re deploying to. For a while now, there are platform level scripts available to figure out which targets are available in the system (Cordova wiki) but they are not easily accessible from the Cordova CLI.
With the introduction of --list Cordova users will be able to see which targets are available in their system. For a second, let’s assume we have the latest Cordova installed:
cordova run --help
will print the following on our console window:
Please note that we now have --list as an available option. If we want to deploy our app to an Android emulator/device all we have to do at this point is to type in the following:
Working with Cordova is usually pretty straightforward, the CLI is very flexible. However there are times where a developer might need to change some behavior in Cordova or apply a fix. In order to be able to apply patches on Cordova, first we have to uninstall it using NPM.
npm uninstall -g cordova
After removing cordova from global we need to install 3 repositories.