cordova-serve-android is pointing to wrong ip
See original GitHub issueI have a few virtual network cards, and when serving from android, it’s getting the wrong IP, probably from the function address.ip()
When running cordova-serve-android, I see this line: updating cordova config.xml content to http://192.168.56.1:8080
while my actual IP is 10.0.0.4.
This is the output of ipconfig:
Windows IP Configuration
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::38bb:d8:1abc:b66f%12
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Wireless LAN adapter Local Area Connection* 3:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Wireless LAN adapter Local Area Connection* 1:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::2130:a805:1ef6:d328%2
IPv4 Address. . . . . . . . . . . : 192.168.187.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::65ed:ae22:2042:7e31%21
IPv4 Address. . . . . . . . . . . : 192.168.127.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . : Home
Link-local IPv6 Address . . . . . : fe80::946a:4696:6997:816f%8
IPv4 Address. . . . . . . . . . . : 10.0.0.4
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
I tried configuring “host” in vue.config.js file:
devServer: {
host: '10.0.0.4'
}
This fixes npm run serve
but is ignored in cordova-serve-android
.
I’m happy to PR if you think this is a bug. Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Android Simulator how does it connect to local IP addresses?
The emulator points to the live network and not the local network in my company. This is strange and I know that I...
Read more >Config.xml - Apache Cordova
This changes what happens when the app is launched from app icon or intent and is already running. AndroidXEnabled(string) ==Android== Default: false. Sets...
Read more >Using Cordova 6.x with Ionic
Add the Scandit Data Capture SDK for Cordova · 1. Download our Scandit Cordova 6. · 2. Delete the following line in the...
Read more >Mobile App Build Commands | Quasar Framework
quasar/app-vite) The Quasar CLI list of commands when developing or building a hybrid mobile app with Cordova.
Read more >cordova-plugin-ping - npm
Although the object is in the global scope, it is not available until after the deviceready event. Ping a domain. query : Domain...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok, thank you for sharing the information… If I find some time, I’ll maybe investigate to start a prompt, if there are multiple IPs…
I’m running win 10 and changing the adapter priority to 1 solved the
The connection to the server was unsuccesful (https://"192.168.56.1:8080")
I can now runnpm run cordova-serve-android
with no issues.