Bill Noble
Bill Noble

Reputation: 6744

Test XCode app running on physical device with local server

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!

Upvotes: 2

Views: 2665

Answers (2)

Bill Noble
Bill Noble

Reputation: 6744

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:

  1. Download from https://ngrok.com/
  2. Run: ngrok http 8000 in terminal (where 8000 is your port)
  3. Cut and paste the displayed ngrok url (e.g. http://a021v2tc.ngrok.io) into your app

So simple. And works!

Upvotes: 8

Eren
Eren

Reputation: 53

  1. Check if iPhone connect the same wifi with your server.
  2. 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

Upvotes: 0

Related Questions