telerik / mobile-cli-lib

Contains common infrastructure for CLIs - mainly AppBuilder, NativeScript, DDB and Proton.
Apache License 2.0
11 stars 10 forks source link

fix: `tns run android` command fails when no emulators are available #1124

Closed rosen-vladimirov closed 6 years ago

rosen-vladimirov commented 6 years ago

tns run android command fails when there are no Android emulators available. The problem is that the output of avdmanager list avds is incorrectly parsed by CLI and it fails (output is Available Android Virtual Devices:\n). Fix this by improving the parsing logic. Also fix incorrect checks for executables on Windows - the files have .bat extension, which was not added, so the check if the file exist was failing. Unify the calls to adb devices - curently there are two implementations on different places in the code - unify them and add a new method that does not fail in case adb devices command fails. The new method is usable when we want to list currently available simulators/emulators.