iOS Swift: find Macbook Computer Name/Ip Address on connected Iphone - ios

For local development, I was hoping to programmatically get the computer name or ip address of the macbook my iphone is connected to. I've been looking at hostess; however, it seems to only provide my iphone's ip address. Is this possible?
Thanks so much for the help!
Dave

What I've experienced is that if you're building an Xcode project on an iOS device, and then run the project with the debugger attached, it routes all of the iOS device's networking through your computer. So it will only show your computer's IP address, not the device's. It looks in the debugger as if that's your iPhone's networking info, but it's really your computer's.

Related

Xcode9 wireless debugging doesn't connect on the university network

I've been trying to use wireless debugging on Xcode9 on the network as it'd be pretty useful to have for a project I'm working on, and it connects normally to my home network. However, when I try this on the university network to work on my project it doesn't seem to connect at all. I've tried resetting the Location & Privacy Settings on the iPad, resetting the Network Settings, unpairing the device, and restarting both the Mac and the iPad to no effect.
No network connection
I can confirm that both the iPad and the Mac are connected to the same university network.
Using:
macOS Sierra 10.12.6 (Macbook Pro)
XCode 9.0
iOS 11.0
There is one thing I tried when I had the similar problem as you have:
1) Try connecting to your iPhone or iPad by specifying its IP Address.
Let me know if that works for you.
Once, I was able to connect to my iPhone in the university network by doing that. But then I lost the connection after 20-30 minutes. After that, I was not able to connect with my device by using its IP address there. Maybe it has something to do with the network configuration as the network is public, but not sure.

iPhone connection to localhost rails sarver

I am creating Rails server for iPhone app.
I want to debug on iPhone device not on iPhone simulator.
So, I connect iPhone to mac book air by USB, and connect to Rails server.
But, iPhone could not connect to Rails server.
Environment
Rails 4.2.3
Server localhost:3000
Xcode 6.4
iPhone iOS 8.4.1
en0 inet 192.168.11.7
As long As I searched, when iPhone device connect to localhost server, the url is http://192.168.11.7:3000/~.
But, mac console show nothing and xcode show "The request timed out." after a while.
If anyone know how to fix the problem, please tell me.
Use the wonderful http://xip.io/
You don't need to install anything - just go to
http://192.168.11.7.xip.io:3000
on your phone.
If you want to use a particular domain name, eg if your app behaves differently depending on domain names or subdomains, you can do eg
http://mydomain.foo.192.168.11.7.xip.io:3000
EDIT: my answer is actually about connecting to your server over the internet rather than a usb cable. I'd recommend that you use the internet rather than the USB option if possible as it's simpler. xip.io will not work if you can't access the internet.
You probably tried that but funny enough, in my case turning my iPhone off and on again actually fixed the issue.
I had the same problem, my app was working fine and all of a sudden it stopped working although nothing had changed. I could access the internet, the browser was accessing the rails app url just fine but my iOS app did not seem to be able to connect to it.
I needed to run my iOS app from Xcode with my local rails server to my device and xip.io was the solution.
Get the ip address of your computer from the wireless network you are connected to and put that into networking.swift like so.
http://11.1.11.100.xip.io:3000
Make sure the rails server is running and your device is connected to the same network as your computer and build the app.

Find device on personal hotspot network in iPhone

I need find IP of device which is connected on iPhones personal hotspot.
My solution is check every IP(from 172.20.10.2 to 172.20.10.255) which returns html with certain words.
Because device return html page on 80 now device has 172.20.10.7 IP on iPhones personal hotspot network.
iPhone IP is 172.20.10.1 (as gateway) on iOS 6.3 and IP getting started from 172.20.10.2 i think.
For my solution i need know: what is IP give personal hotspot on iOS7.
Can anybody help me with this?
I'm not have device with iOS7 only iOS6.3.
Just give me internal IP of device which connected with iOS7 personal hotspot device.
Thanks.
iOS 7 device hot spot gives an IP address in the 172.20.10.* range, just as for iOS 6

AIR mobile debug - "Enter ip address or hostname"

I'm developing a mobile app using Flash Builder 4.6/AIR. I've been able to debug on the device (an iPhone 4s) just fine until now. I connect my iPhone to my mac with the USB corad, and debug.
All of a sudden I'm getting a black screen for close to a minute. Then I see the "Enter ip address or hostname" dialog. If I enter the ip address of my machine it doesn't matter. The window goes away for about 15 seconds, then comes back. Meanwhile, Flash Builder on my mac times out. The only way I can actually see the program running is if I hit 'Cancel' on that dialog. The app then launches, but I cannot set any breakpoints, cannot debug.
Everything I've found on the internet around this issue mentions it in reference to AIR for android -- not iOs. But I'm seeing it with iOs.
Anyone know what's going on here?
Thanks.
To make it easier for future readers, the official answer to this issue;
With the current (official) version of the AIR SKD (3.2) USB debugging is not supported on iOS devices. This is going to change with the future 3.3 release which (amongst others) adds USB debugging support:
"USB debugging for AIR iOS
This new feature allows the iOS developer to connect to the desktop via USB while debugging their mobile applications instead of relying on network connectivity."
With version 3.2, iOS debugging works over the local network, so both devices (the machine the debugger runs on and the iOS device) have to be in the same network so that they can communicate with each other.
See also the reply to What is the address of my Flash debugger?, it really helped me to resolve similar issue. Using 'ios-debug' mode was the way to go.
If you still have this problem using Android with the device connected to same wifi, try checking firewall rules. In my case FlashDevelop was blocked and I didn't suspected because of updates worked perfectly.

BlackBerry simulator settings for VPN

I want to test a project from the BlackBerry simulator, but our webservice runs on an external server that can only be accessed using the vpn from our PC's.
I can access the webservice from the Android simulator without doing anything special. However I cannot access the webservice from the BlackBerry simulator -- not even from the browser of the simulator -- though I am able to connect to other services on the web from the BlackBerry simulator.
What kind settings are there to fix this?
There's a network setting for the simulator that might be useful for situations like this. You could try manually assigning the vpn ip address you were given.
/ip-address={string}
IP address of the simulated handheld. This should be left blank under normal circumstances. If running on a PC with multiple IP addresses, one can be specified here to cause the simulator to use it.
Cheers
Ray
Ok...anyone bumping on the same problem...
Append ";deviceside=true" to the URL from which data is to be fetched

Resources