Skip to content

emulate android command does not detect failed to start emulator #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
teobugslayer opened this issue Jul 14, 2015 · 3 comments
Closed

Comments

@teobugslayer
Copy link
Contributor

teobugslayer commented Jul 14, 2015

Sometimes the emulator cannot start or exits unexpectedly. For example, there may be a configuration issue. In this case, the CLI waits until a timeout expires, which in some case may be infinite.

@teobugslayer
Copy link
Contributor Author

The technical issue is that emulator.exe starts a sub-process which does the actual work and immediately stops with success exit code. We cannot simply check for exit code.

In Android Studio Beta 5 and accompanying SDK emulator.exe stays alive and we can check its exit code.

@dtopuzov
Copy link
Contributor

{N} CLI in master with latest Android tooling, Intel HAXM not installed and x86 emulator:

C:\Users\topuzov>tns emulate android --path TestApp
Starting Android emulator with image Emulator-Api21-Default
....
and it hangs with out any logs.

When run with --log trace:

Looking for project in 'C:\Users\topuzov\TestApp'
Project directory is 'C:\Users\topuzov\TestApp'.
Analytics statuses:
{ TrackFeatureUsage: 0, TrackExceptions: 1 }
Trying to track feature 'CLI' with value 'emulate|android'.
Statistics was sent successfully (xhr).
startLookingForDevices; platform is Android
spawn: D:\adt-bundle\sdk\platform-tools\adb "start-server"
Result when throw error is false:
{ stdout: '', stderr: '', exitCode: 0 }
spawn: D:\adt-bundle\sdk\platform-tools\adb "devices"
execFile: D:\adt-bundle\sdk\platform-tools\adb "devices"
Starting Android emulator with image Emulator-Api21-Default
spawn: D:\adt-bundle\sdk\tools\emulator "-avd" "Emulator-Api21-Default"
execFile: D:\adt-bundle\sdk\platform-tools\adb "devices"
execFile: D:\adt-bundle\sdk\platform-tools\adb "devices"

Not very good user experience.

@tsonevn tsonevn added this to the 2.6.0 (TBD) milestone Dec 5, 2016
@pkoleva pkoleva modified the milestone: 2.6.0 (TBD) Jan 26, 2017
@dtopuzov dtopuzov self-assigned this Apr 7, 2017
@dtopuzov
Copy link
Contributor

dtopuzov commented Apr 7, 2017

No infinite wait with {N} CLI 3.0.0.

Tested with following steps:

  1. Kill all running emulators
  2. Remove IntelHAXM
  3. Run tns run android

After timeout now we say:

Searching for devices...
Starting Android emulator with image Emulator-Api25-Google
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 alloc
ated RAM for the virtual device.

@dtopuzov dtopuzov closed this as completed Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants