Skip to content

Debug port -1 when run on android emulator #359

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
iamkarlson opened this issue Mar 20, 2015 · 7 comments
Closed

Debug port -1 when run on android emulator #359

iamkarlson opened this issue Mar 20, 2015 · 7 comments

Comments

@iamkarlson
Copy link

Hello, I can't run debugger on android emulator because script stuck here

\lib\common\mobile\android\android-device.js:214
var dbgPort = this.startAndGetPort(packageName).wait();

After wait dbgPort geting -1

@iamkarlson
Copy link
Author

I continued my investigation and I've found cause of port -1.
File envDebug.out not exist in files directory. What am I doing wrong?

@rosen-vladimirov
Copy link
Contributor

Hi @iamkarlson
Please excuse us for the late reply. Can you try running the command with --log trace, for example
tns debug android --start --log trace
If you can send us the output, we'll investigate it on our side. Also what is the android version of your device/emulator image?

@iamkarlson
Copy link
Author

Yes, sure. You can find it here http://pastebin.com/tDf836qd

Android version is 4.2, but I also tried to run on 5.0 image and intel/arm platforms

@slavchev
Copy link

It seems that the CLI cannot establish connection with your device/emulator. Currently, the CLI has hard-coded timeout set to 30 seconds which sometimes is not enough. I logged an issue here #375.

If you feel adventurous, you can change the timeout to, say, 60 seconds. From your logs I assume that you are running on Windows box, so you can edit %localappdata%\..\Roaming\npm\node_modules\nativescript\lib\common\mobile\android\android-device.js file (the exact location may be machine specific). You can search for for (var i = 0; i < 30; i++) and replace it with for (var i = 0; i < 60; i++) to increase the timeout to 60 seconds.

EDIT: Also make sure that your device/emulator has external storage (sdcard) attached.

@iamkarlson
Copy link
Author

Oh, no. My emulator doesn't have attached sdcard, but my phone does. And on my phone debugger are working fine. Could please find out way to debug apps without mounted sdcard?

@slavchev
Copy link

We are already researching other options. I'll close our internal issue and make a public one so everybody can monitor its status.

@dtopuzov
Copy link
Contributor

Closing this issue, see #661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants