ipad programming with vpn issues - ipad

Do iPad in the simulator and the Macbook share a same network? I have connect a wifi then VPN on my Macbook and everything works just fine on the outside Safari. But when I open the iPad simulator and it seems on that inside Safari the VPN is not set up yet cuz I cant access to my specified website. (But internet still works. I guess it is the wifi)
Not sure if I make it clear. I wonder how can I solve this problem. Thanks for helping!

Generally the iOS Simulator runs with the same IP and actually in the same process space as other applications on your Mac.

Related

Xcode 9 Wireless debugging not working

For some reason the wireless debugging does not work here. Here is what I've done:
Using newest Xcode 9
Using newest iOS 11 on my iPhone 7+
Both devices are in the same network
Connected the iPhone via Lightning, selected "Connect via Network" in the Devices & Simulator menu
Run an app on the iPhone while still connected via Lightning - everything works
But as soon as I unplug the phone, Xcode is no longer able to connect with the phone. I can ping the phone with the Mac, but even the "connect via ip" option in Xcode does not work.
Anybody got tips on how to get this working?
I had the same issue, but it was intermittent - i.e. sometimes the globe would not appear next to the phone name in Xcode Devices and Simulators window and when the phone was disconnected from the lighting cable, I could not debug to it from Xcode. My fix was much simpler, though - I just turned WiFi on and off both on the Mac and on the phone. After the devices reconnected to the network wireless debugging was available again. This seems to be an issue with the network communication (regardless whether the device can be pinged or not).
Make sure System Preferences->Internet Sharing is enabled using USB ports:
I was able to find a solution to this on another stack overflow question:
How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?.
You can also check this answer: "Connect via network" wireless debugging not working Xcode 9
Near the bottom, from "IOS DEV". Briefly, the solution ended up to be to unpair my phone, disconnect and re-pair. After that Xcode automatically added it with the globe. As an FYI, I was able to ping my iPhone using the network utility prior to the un-paring but was still unable to get the phone to connect. good luck.
Restarting xcode is the only thing that fixed this intermittent connectivity problem for me.
I realized this can also happen if my Mac is connected to a VPN. I had to:
Kill the VPN connection
Turn the computer's wifi off and back on
Open Devices and Simulators
Plug the device in and the globe icon should appear.
Unplug the device and make sure the globe icon is still there.
Run the app via network!
Wireless debugging mysteriously stopped working for me until I turned off my VPN client. I now believe that I had the VPN turned off when I was trying it out the first time, but then the VPN auto-connected after my computer restarted sometime later.

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 not connected. Xcode will continue when iPhone is connected

I have my iPhone connected to Xcode. It used to work just fine recently. I see it in the Devices and Simulators section, but when I try to compile my app, it says:
D's iPhone 6S is not connected. Xcode will continue when D's iPhone 6S is connected.
In the Devices and Simulators I see it as disconnected.
I tried restarting the phone, turning it's wifi on and off. It's connected to the same wifi network, I tried restarting Xcode, nothing. I run Xcode 9, Beta 6 at the moment. Does anyone has similar issue and hopefully know how to solve it?
Troubleshooting:
plug in your iPhone.
Open Xcode
go to window -> Devices and Simulators
Right click on your device
click Unpair Device and unplug it.
restart Xcode
restart your iPhone.
Connect your iPhone via USB
run your app
then unplug it, and it should run via the wifi again.
Set up
Window -> Devices and Simulators
Choose your device from the list.
Tick the box for "connect via network."
In Window > Devices and Simulators, right click on your iPhone and "Connect with IP address", then enter the iPhone IP address and you're connected.
Turn off WIFI on Mac, and also on your iPhone too. Then turn on WIFI again on both devices.
I frequently face this issue since I don't use USB cable to build the app to my iPhone. So this is my usual way to resolve the connection problem.
As Sam H.'s answer, can Connect via IP Address. This is XCode 9 or 9.1 's function. And need your device update to iOS11 +
Apparently, more people have this issue. The only "solution" I found was to connect the iphone with a USB, run the app and then try to run it using wifi. This usually solves my problem.
You can also connect via IP address
While Xcode is open, go to
Windows -> Device and Simulators
right click your device and connect via IP address. You can get your phone IP address from settings under wifi and clicking the info button on the network.
Restarting the wifi on my Mac worked for me.
I'm using Xcode 9.1 and suddenly had this issue.After reading other answers a realized it is a Xcode bug via wifi debug.My solution was to connect the iphone with a USB, then go to the Add Additional Simulators,then come to the interface below,uncheck "connect via network".
Problem sovled,and back to debug via a USB.
I was able to reconnect using this method:
Disconnect/Unplugged the device from Mac
Close X-Code
Run "sudo pkill usbmuxd" in terminal
Reopen Xcode
Reconnect Device
Try this if unpairing method does not work.
Making Cellular data Off solved my problem
I had to update Xcode in my case. I tried literally everything else in this thread.
I had this issue when I changed my network connection on my Mac and in this case reconnecting the phone with an USB cable doesn't work. I had to restart xCode.
I had to reopen Xcode with my iPhone X unlocked and then I had to open Windows->Devices immediately afterwards.
Then the message was changed into:"iPhone X is busy: Preparing debugger support for iPhone X"
Also make sure your iOS device is on the same wifi network as your Mac, otherwise Xcode will insist you connect your device via USB, even if you've checked the box to use wireless development for that device.
There could be more than one reason why xcode forgets the device often. One of them could be the dynamic IP which is assigned automatically.
Apart from general troubleshooting (device is unlocked etc), here are few suggestions based on my experience.
1) Check if you are using the SAME WIFI on computer and device.
2) In Xcode > Devices and Simulators > Right Click > Unpair Device and connect again.
3) Prefer to use static IP. At least for the device (Give Manual IP address in the iPhone).
4) In Xcode > Devices and Simulators > Connect via IP Address
5) Use USB cable to run the app and then unplug to use wireless solves it most often.
6) Disconnect and Reconnect Wireless on Computer & Mobile Device
7) Turn off the Cellular Data
8) Turn off any VPN you are using.
9) Check your Network Settings on Computer and Device. Disable any suspecious setting (Proxy etc).
10) Restart Device and Computer. It often resolves few network interface problems.
Make sure your Mac and device connected in same network(Wi-Fi) connection.
In my case a pending software update on my iPhone was preventing it from accepting new builds from Xcode - even over USB.
I tried all the other suggestions in this thread and nothing worked, but accepting the pending update on my phone fixed the problem.
This is just to add the other possible reasons that the answers forgot to mention:
You got a new phone and Xcode is trying to connect to the old phone:
Window<< Devices and Simulators:
Press the + button and connect your phone via usb cable and click
your on your device. It should add it at that point.
You could also try running bluetooth instead of wifi, but it might still do the same problems. Make sure your device is connected correctly
1 - Go to Xcode - Window - Device and simulator - Unpair device
2 - Xcode and Mac both are restart and open Xcode again and connect your device Via USB cable and run it.
Restart Xcode & if issue persists do steps 2-4.
Open Devices and Simulators window in Xcode (shortcut is ⌘⇧2 command+shift+2)
Make sure your device is active (press home button & enter passcode if needed)
Open terminal & run netstat command.
You device will be reconnected
Just in case someone did what I did: I used to have wireless connection with my mac mini but one day I decided to use a cable. From that day I had problems with my devices, I always had to use usb the first time I opened Xcode. When I removed cable connection everything worked fine as before.
I tried a combination of the above solutions and can't pinpoint what solved it.
When Xcode was stuck on trying to connect to my wireless iPad, I had to do was start browsing with Safari on my iPad. I think that somehow refreshes the network on the iPad.
The Xcode's 'Device and simulator' may not properly reflect the connection status between the device and mac so after browsing with your iPad/iPhone hit run on Xcode and then just wait till they find each other
I had the same problem yesterday/today. Tried the various suggestions here but none worked. Except maybe, restarting the iPhone. I was able to install my app!!
Previously I had a Xcode/iOS version mismatch but currently at 12.2/14.2 which should and finally did work.
My problem was actually the cable itself, seems that some of the cheap cable you buy might not work 100% with your ipad/iphone. Try with a different cable
You must put a passcode on the device, otherwise wifi debugging will not work.
Unlock your iPhone or iPad (helped me).
Apparently the Apple engineers don't really have networking under control.
Typically, a dance of (in the order of increasing inconvenience)
Toggling "Connect via Network"
Toggling "WiFi" on Mac and iPhone
Unpairing + Repairing the device in the Xcode organizer
Restarting (yes, just like Windows) the Mac and the iPhone
works for me.

Run app in iOS simulator with VPN connection

I want to run my app in iOS simulator with VPN.
My mac is connected to a VPN network, i want to run my app in simulator, is this possible.
Please help.
If your VPN is "L2TP over IPSec", just need to make sure you've checked "Send all traffic over VPN connection" in System Preferences / Network / YourVPN / Advanced:
The answered marked as correct works but you need to start/restart the simulator once you are successfully connected to the VPN.
I make this comment in order to avoid what happened to me. I spend a day trying to making vodo magic and at the end the solution was just restarting the simulator.
Yes it is possible and i have already worked on iOS simulator with VPN connection. Basically you don't have to install or make any changes for this.
When you connect to VPN on Mac you can browser the sites or system to which you are VPN connected. Since iOS simulator uses your Mac's connection it will also be able to connect to the VPN network.

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.

Resources