mousedoc / nox-adb-connector

Nox App Player ADB Connector
MIT License
18 stars 11 forks source link

Connection is not stable #3

Closed BJSam closed 3 years ago

BJSam commented 3 years ago

it is getting disconnected very frequently.... even it is not connecting for 1 min

Any solution??

mousedoc commented 3 years ago

First, Try this manually. Link basically, it is the program that executes this command.

and can I see the output on the Application screen when the connection is lost?

BJSam commented 3 years ago

thanks for the reply, I have done these and its working fine...

To Debug react native apps on nox player You need to follow these steps

  1. Enable developer mode and on use debugging in nox player, also disable verify apps over usb debug not necessary but in case..
  2. Run: adb connect 127.0.0.1:62001
  3. Run: yarn android This will install app to nox player After this the app should work but mostly this connection is unstable if it's stable go ahead you got luck if not Then
  4. Open app in nox you will see red error saying metro not connected, to solve it
  5. Run: adb connect 127.0.0.1:62001 && adb reverse tcp:8081 tcp:8081
  6. Now your app should work...

So to make it easy add an scripts key like below in package.json .. ..... "scripts":{ .... "nox":"adb connect 127.0.0.1:62001 && adb reverse tcp:8081 tcp:8081", .... } ....

For every time you get error for metro connection run: yarn nox

Maybe it works for other 3rd party emulators but I tried this in nox player.

mousedoc commented 3 years ago

I don't know much about react native development. it seems to be a problem with the link below.

https://stackoverflow.com/questions/42064283/could-not-connect-to-react-native-development-server-on-android https://stackoverflow.com/questions/46235080/nox-emulator-with-react-native

This program seems to have caused the problem by executing only the adb connect. (no adb reverse)

Now, Is the connection stable?

BJSam commented 3 years ago

yes it is stable. I think the reverse command is making it stable. BTW I have zero knowledge in adb

BJSam commented 3 years ago

hay in android studio with flutter i am getting this error::

Launching lib\main.dart on ASUS Z01QD in debug mode...
Running Gradle task 'assembleDebug'...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
* daemon not running; starting now at tcp:5037
* daemon started successfully
adb.exe: device '127.0.0.1:62001' not found
Installing build\app\outputs\flutter-apk\app.apk...
Error: ADB exited with exit code -1
Performing Push Install
adb: error: failed to get feature set: device '127.0.0.1:62001' not found
Error launching application on ASUS Z01QD.

can you help??

or can you write a script to check if adb connection is established for 62001 port skip else reconnect script should keep on running ... is it good to do??

mousedoc commented 3 years ago

You can check connected devices by adb devices

yousefkazemy1 commented 1 year ago

The connection between adb and nox is not stable. Actually, when connect to it, after a while it will be disconnected. Is it a bug or maybe there is a config I've lost? I really appreciate your help.

mousedoc commented 1 year ago

The connection between adb and nox is not stable. Actually, when connect to it, after a while it will be disconnected. Is it a bug or maybe there is a config I've lost? I really appreciate your help.

This is simply giving the nox_adb connect command instead.

It would be better to see the log by executing the nox_adb command in cmd directly.

Others said that it was unstable because they did not do adb reverse, but I can't answer in detail because I don't know much about flutter.