Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you set the ip address for Phonegap Developer app

I'm working with Phonegap Developer App to load my application on devices for testing. When running phonegap serve in command line, I get the following:

[phonegap] starting app server... [phonegap] listening on 192.168.1.210:3000 [phonegap] [phonegap] ctrl-c to stop the server [phonegap]

We are instructed to enter 192.168.1.210:3000 in the Phonegap Developer App in order to load the application on our different devices.

How can you customize the 192.168.1.210:3000 value?

like image 962
Tom Schreck Avatar asked Nov 11 '22 00:11

Tom Schreck


1 Answers

I had the same problem, I have multiple addresses for various reasons and for phonegap to simply ping an address and call it good wasn't cutting it.

This isn't the most elegant solution, but it works as a fast hack.

Edit the file <path to npm install>\npm\node_modules\phonegap\node_modules\connect-phonegap\lib\util\ip.js

At the end of the file right before callback(null, localAddress);

Add localAddress = '<yourip>';

Hopefully they might add a command line argument.

like image 172
Jim Avatar answered Nov 14 '22 23:11

Jim