Search code examples
androidnativescriptandroid-virtual-device

Android emulator instant closing after starting up


I created new project.

When I'm doing tns device --available-devices. Everything seems to be ok.

Available emulators
┌─────────────┬──────────┬─────────┬───────────────────┬──────────────────┬────────────┐
│ Device Name │ Platform │ Version │ Device Identifier │ Image Identifier │ Error Help │
│ test        │ Android  │ 7.1.1   │                   │ test             │            │
└─────────────┴──────────┴─────────┴───────────────────┴──────────────────┴────────────┘

When I'm doing tns run android, something is fast opening and closing (~1sec).

Here is tns run android --log trace

I'm totally new, I tryied a lot of things from others but nothing works.


Solution

  • reinstall the emulator maybe it causes cache issues & personally I suggest you use your mobile as an emulator which is more efficient

    1. Connect the USB cable between mobile and pc/laptop
    2. enable developer options from your mobile
    3. enable USB debugging

    boom, now you are ready to test your app