I have searched high and low for a solution to this which I am sure must exist but I have failed to find one that works.
I am running XCode 7.3 and iOS 9.2 on an iPhone.
I have a test server running on 127.0.0.1:8000
I cannot get my app running on the iPhone to connect to either 127.0.0.1:8000 or 192.168.1.200:8000 (which is the local ip address of my server).
There must be a way to give the iPhone app access to the local server if only I knew how!
The best solution to this problem, that many app developers have, is to download ngrok which acts as a proxy website.
ngrok is insanely easy to use:
Download from https://ngrok.com/
Run: ngrok http 8000 in terminal (where 8000 is your port)
Cut and paste the displayed ngrok url (e.g. http://a021v2tc.ngrok.io) into your app
So simple. And works!
Check if iPhone connect the same wifi with your server.
You can use Fiddler as iPhone agent to get the detail error message.
There is the link how to capture traffic from IOS device.
here
Related
I have a server running on localhost:5000 on my desktop, and when I make http requests through my react-native app when running on the iOS simulation to it, it works. However, when I connect to a real device, the http requests don't work. What am I doing wrong? Is there something I have to configure?
localhost in your desktop is not the same ip of the localhost of your device.
Get the ip of your computer by typing ifconfig in a terminal, then replace localhost by this ip, you should type something like that in your device browser:
192.168.0.23:5000
Maybe my answer is too late but I ran into a similar situation today and I got it to work by running my node server using the IPv4 of my desktop and then making the request to that IP.
For example, I am running my nodejs development server at http://192.168.0.135:3000(local IP of my desktop) instead of localhost and then I make the fetch API request from my react-native app to http://192.168.0.135:3000/.
Just make sure your nodejs server and your app are on the same local network. My react-native server (metro bundler) is running on a separate PC also in the same wifi network.
If your are on macOS go to settings -> Wifi / and show more,
on bottom you see "IP address", it's your correct localhost for ios physical device !
I've been testing my project on my iPhone6s and it worked perfectly. But today Xcode and Node.js keeps giving me the 'Unable to execute JS call: __fbBatchedBridge is undefined' error.
I'm sure the IP address is correct, my phone is under the same Wifi network with server. The simulator works fine with the server ip. To test if it is something wrong with the project I start another AwesomeProject and changed the IP but still not working. Anyone know any possible solutions?
I faced the same issue in my office Wifi network connection also. This is because of the router configuration. There are two ways to make it work.
Expose the local server using ngrok. But, It will be slow since it is sending everything to server.
Connect your phone using USB cable and type the following command in the computer adb reverce tcp:8081 tcp:8081
I have been working on an application and using compose.io as my database platform. I am able connect to compose in web browser and iOS simulator with:
MONGO_URL="mongodb://myUsername:myPassword#aws-us-east-1-portal.6.dblayer.com:11111/dbName" meteor (run , run ios)
However when I try the same process with run ios-device --mobile-server, or ios-device --mobile-server -p 127.0.0.1:3000 it just keeps creating a local database instance. In Meteor documentation it says may need developer account, but I am assuming that was outdated as of Xcode 7 testing on your own device was free, unless this does not count for database connections.
Any ideas, is my command line string incorrect, or is a developer account required? Maybe something else.
Thanks!
I was able to solve my issue by disabling my cellular network, so that my mobile device(iPhone) and local machine(Mac) were using the same network(Wifi) guaranteed. Be to delete any exiting instance your Meteor app your device before running the following while the device and local machine are on the same network.
MONGO_URL="mongodb://myUsername:myPassword#aws-us-east-1-portal.6.dblayer.com:11391/dbName" meteor run ios-device
I am developing a backend server for an app using PyCharm. This runs on my laptop as 127.0.0.1:8000
I need to access this server for testing from an iPhone. This is connected by wifi to my local network to which the laptop is also connected.
I have tried entering http://mycomputer.local:8000 in safari on the iPhone but I get the message "Safari could not open the page because the server stopped working. I am using the real name of my computer instead of 'mycomputer'.
I am running OS X Yosemite so Web Sharing is not available in System Preferences.
How can I give access to the 127.0.0.1:8000 server to my iPhone?
When you say "backend server", what is the Python project written in? Django, Flask, Pyramid, something else?
)
I want to deploy my app that is created with Phonegap to my BlackBerry Z10 device.
I created some Hello World basic app with Phonegap, then in the terminal (Mac OS Lion) I ran following command:
/Users/macbook/Documents/BB10APP/cordova/run BBZ10
Everythings seems to work fine, but in the end I get a connection error:
[BUILD] BAR packaging complete
Error: Error: Cannot connect: Connection to https://169.254.x.x:443 refused. Please check IP address settings for the target. You may have to reboot the target.
What could be the problem with the connection?
And is there some other tools that I can use to just send the app via USB to the device like on Android?
Thanks :-)
I found a solution if anyone wants to know:
You have to use the device IP address and not the developer IP that is found in the developer settings on the device (where you see your developer token).
And then it will work (don't ask me what the developer ip is for, just annoying to lead developers in a wrong direction).
The device ip can be found in some settings entry on the device (I don't remember in which unfortunately, but it is there). Just dont use the ip from the developer menu that wont work :-)
There are two IPs in Blackberry
IP that is appearing on bottom part of Controller EX. ( 192.168.139.129)
IP that is configured in Blackberry simulator (Security and Privacy -> Development Setting)
EX. ( 169.254.0.1)
Using Controller IP "Network connection problem" issue will be solved
D:\bbndk\hello\platforms\blackberry10\cordova>target.bat add mydevice 192.168.139.129 -t device --password 0000 --pin 00000000