nativescript-cli: Stuck on starting emulator on Android

Issue

I have noticed that from time to time when trying to “run” an {N} application on Android via tns emulate android the terminal gets stuck after:

Starting Android emulator with image Nexus_5X_API_24

and after a flew minutes this error is shown:

Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb server with ‘adb kill-server’ command. Alternatively, run the Android Virtual Device manager and increase the allocated RAM for the virtual device.

Doing the mentioned adb kill-server or timeout increasing does not resolve the issue.

Workaround

Manually start the Android emulator via Android Studio and use tns run android

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

@Plamen5kov Yes of course, finding the source and possibly fixing it so that the execution is not getting stuck is the first concern that should be taken into account. Adding a way to change the default device was as mentioned earlier nothing more than a improvement suggestion rather than a fix for this issue.

I’m with @rosen-vladimirov, the default should use the newest emulator installed. We have a way for the user to use a different emulator using --device flag, and this flag is described in the help of the tns emulate command.