Android detox debug build port 8081 in use - detox

When I build android debug release the app points to the metro bundled on port 8081. I have to run out metro bundles on port 8087 due to antivirus software occupying port 8081. How do o build android debug with the app pointing to port 8087 for the metro bundler?

Related

Could not connect to development server [React-Native]

I create a vanilla react-native application, then I run it using Xcode and the react-terminal window opened but when I try to enable "Fast refresh" from app-in-menu it doesn't show the option, so I tap on "Configure Bundle" using IP: 127.0.0.1 (localhost) and PORT: 8081.
This is the error that occur:
I've reinstall nodeJs, npm and clean caches, but nothing It doesn't work. How to solve this error?

React Native run-ios by simulator error:Port 8081 already in use

React Native version: last 0.60
When I terminal react-native run-ios, first time successed!
But after all failed.
Open the Xcode xcworkspace tips:
Connection to localhost port 8081 [tcp/sunproxyadmin] succeeded!
Port 8081 already in use, packager is either not running or not running correctly
Command PhaseScriptExecution failed with a nonzero exit code
PS: sudo lsof -i tcp:8081 can not find the PID, so no kill.
How to find the port number 8081 or some other actions to build.

Expo start shows "Starting Metro Bundler on port" forever

I am working on react native project.
It worked well before I reinstall computer OS.
Now if I run expo start it just show this.
Starting Metro Bundler on port 19001.
This takes forever.
If I run android emulator here, then this error appears.
Couldn't start project on Android: could not install *smartsocket* listener:
cannot bind to 127.0.0.1:5037: Only one usage of each socket address
(protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
What's wrong here? I am using Genymotion simulator.
I solved this.
I just set path environment to genymotion adb tool directory.
C:\Program Files\Genymobile\Genymotion\tools
And now it works well.
Thanks.

How does the "Reload" work in react-native when running on a physical android device?

When the RN app is run on an android physical devices and the adb is connected over USB how does the "Reload" on the app fetches the files saved on the development project directory. How does the App knows the ip address of the development machine ?
First if you have real device type this code: react-native run-android --deviceId [YOUR ID]
If you want debug the app through Wifi you must first find your ip and then in adb type:
adb tcpip 5555
adb connect [YOUR IP]
Then type react-native run-android --deviceId [YOUR ID] again with your new id ([your device ip]:5555)
For the first time your app will be built. But for reload index.js open dev menu , go to dev setting in Debug server host & port for device type [YOUR PC IP]:8081
When the application is started the react-native run-android ... command does the reverse(forwarding the ports) of the ports using the following command which is visible in node start logs.
adb -s [device_id] reverse tcp:8081 tcp:8081
So after this when the "RR" command is received by the RN app, it loads the page from the localhost (http://localhost:8081/xyz.js?foo...) which is being forwarded to the development host.

Could not connect to development server on android emulator and on real device

When I run "react-native run-android",it gives me error:"could not connect to development server...".-- The red screen
OS: Windows 7
node version:8.2.1
npm version:4.1.2
react-native version:0.47.1
react-native-cli version:2.0.1
android device and emulator version: 5.1.1
i followed following command:
react-native init ProjectName
cd ProjectName
react-native run-android
And this makes the package server run automatically.
But I am not able to access the package server from browser on the machine and the mobile.
My android device connected to computer has debugging enabled i checked it using adb devices command.
Usb debug is on.
I tried running the project on real device and on emulator. On Both I got error: "Unable to load script from assets 'index.android.bundle' Make sure your bundle is packaged correctly or you're running a package server'.
reloading i get the error: "Could not connect to development server."
Then i set the host and port number on development setting on both and got the error "Could not connect to development server."
enter image description here
So how to fix the red error screen issue?Any suggestion is appreciated!
Try to open this link in browser. It will automatically bundle the assets.
http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false
You development server should be running while running this command.