I am using code-push-server due to connectivity issues, I have set everything okay, The app displays a Update App Dialog but cant fails to download. In the logs, I find

[CodePush] failed to connect to localhost/127.0.0.1 (port 3000): connect failed: ECONNREFUSED (Connection refused)

Also I can see the first request from code-push and the JSON sent back is like below,

{
    "updateInfo": {
        "downloadURL": "http://localhost:3000/download/FkLTVi7MtDtKPXgmUgeV7XXWftWT",
        "description": "",
        "isAvailable": true,
        "isMandatory": false,
        "appVersion": "1.0",
        "packageHash": "cbf70f60186b8be7a8ec213170f2553159ac3jfdfdk6f2770c207b182a962b7a53f",
        "label": "v3",
        "packageSize": 328578,
        "updateAppVersion": false,
        "shouldRunBinaryVersion": false
    }
}

On the development machine, I can access the download url and the bundle is downloaded.

Kindly advise if I am doing anything right.

2

There are 2 answers

0
IsaacK On BEST ANSWER

I got this to work by changing the localhost download to machine IP address in the code-push-sever config file.

0
Max Mironov On

If I get you correctly you are able to dl update when using simulator/browser on your dev machine but it doesn't work on your devices. You should use your dev machine's IP address like e.g. 10.0.6.43:3000, not localhost:3000 in this case.