2

I am trying to do NativeScript development on an Azure virtual box. The installation of the NativeScript development environment has been completed successfully, as I do not have any issues when I am running the

>tns doctor

command:

enter image description here

Once I try to run my application:

>tns run android --bundle

I see that it is successfully installed on the device identified as 'emulator-5554' but then this error pops up:

Unable to apply changes on device: emulator-5554. Error is: connect ECONNREFUSED 127.0.0.1:50232.

Here is a screenshot of my VS Code Terminal window:

enter image description here

It does not matter whether I start the emulator via VS Code or in Android Studio, via the AVD Manager. The same error occurs. It's just the port on the localhost (127.0.0.1) that is different.

I can see the emulator running, but it stays with a blank screen, without showing my application:

enter image description here

Now, since that is an Azure box, IT has all kinds of restrictions on it. All the ports are locked down, but I can get them to open one for my needs. The problem is that I do not know which one to ask to be opened. As I said, every time the emulator is restarted or accessed, the port in the error (ECONNREFUSED 127.0.0.1:50232) is different.

Anyone else has faced this issue and is there an easy solution? I was hoping that maybe there is a way to launch the emulator and have it listen to the same port always. Can that be achieved?

TIA, Eddie

Edit [Feb. 12, 2020] One of my IT friends has created a new inbound port rule on that server:

enter image description here

and now I do not get that error anymore. Instead, I get a different error. Maybe it's not an error per se, but the application does not start on the emulator which appears to run on its own:

enter image description here

Does anyone have a suggestion for this one?

Eddie
  • 271
  • 4
  • 18
  • Yes you can configure the port number using ADB, refer the official [ADB docs](https://developer.android.com/studio/command-line/adb) for more details. – Manoj Feb 11 '20 at 23:48
  • Thank you, Manoj for your reply and suggestion. As I was looking into the documentation for the ADB, my IT guy created a new inbound port rule on that server and now I no longer get that error, but a different one. I have edited my question above and have added these new details. – Eddie Feb 12 '20 at 20:39

0 Answers0