iOS simulator no internet access - ios

I'm maintaining an iOS app that's a few targets behind, and when I run the simulator for the code, it launches the app succesfully, but when I attempt to login, the simulator reports it can't get access to wifi.
I was able to get the simulator working when I was using an older version of xcode, but I've recently updated osx to El Capiton, so I can't use that xcode anymore.
- I've tried Revert content and settings on the simulator
- I'm not behind a proxy.
- This did work before when I was using older xcode version
- current xcode version: 7.1
- application Deployment target: 7.0
I've been on SO for a little while now, nothing I can find works, I've been through the first page of Google, and I'm not sure what else to do except try to downgrade my mac pro just so i can use old xcode again. Help?
Thanks.

My pc had access to the internet, but the simulator could not open a website in Safari.
What solved it for me was simply turning off and on the wifi

With the simulator opened try to:
Simulator > Reset Content and Settings

This works for me...
Stack Overflow - "iPhone simulator cannot connect to internet
"
1.Turn off lan connection;
2.Turn on wifi;
3.Settings > Developer > Allow HTTP Services (turn on);
4.Restart Xcode and simulator.

With the simulator opened try to:
Device> Restart

Related

Xcode 12: Failed to start remote service "com.apple.debugserver" on iOS device

I updated my Xcode to Version 12.4 (12D4e) and after that I am unable to run my app on my device
iPhone X iOS 14.4.2.
Its alway show this Error
When I check my device connected status, Its show as connected
Action I applied
Clear DerivedData folder.
Unpair device and connected again.
Drank 20+ coffees.
I was able to fix the Xcode 12 app install/deployment issue described above:
Failed to start remote service "com.apple.debugserver" on device.
Domain: com.apple.dtdevicekit
Code: 811
Recovery Suggestion: Please check your connection to your device.
User Info: {
DVTRadarComponentKey = 261622;
}
...
by doing the following steps:
Quiting Xcode.
Deleting Xcode cache directory (ie, rm -rf ~/Library/Caches/com.apple.dt.Xcode).
Rebooting the offending iOS device.
Connecting the iOS device to Xcode by cable (instead of wireless network connection).
Starting Xcode again.
By the way, I've a setup very close to yours:
Xcode 12.5 (build 12E262) and
iOS 14.5.1 (on a iPhone Xʀ device)
1st solution
I fixed this by:
Closing Xcode
Deleting the current iOS version in my folder that's related to my device.
~/Library/Developer/Xcode/iOS DeviceSupport
Restarting Xcode. Wait a little bit for it to refresh and copy cache files in my case then Run.
Based on Can I delete data from the iOS DeviceSupport directory? it's ok to delete the iOS DeviceSupport folder.
I noticed when I did it and reconnected my device it re-downloaded the iOS device Support files.
If the support files don't download and the cache files are not copying, try restarting your computer as well.
I started also getting this error:
Errors were encountered while preparing your device for development.
Please check the Devices and Simulators Window.
Restart your phone and reconnect it to the compter if this happens. Then you should get a message in Xcode saying:
Preparing your phone for development.
2nd solution
Unpair the device in Xcode.
Clean the project.
Unplug and then restart iPhone.
Restart Xcode.
3rd solution
If none of the above worked, I was able to run the program by re-enabling Connect via Network.
After doing this now I can run project via USB.
4th solution
I submitted this bug to Apple. Apple also suggests this can be caused by faulty data cords. Maybe try another cord as well.
Unplug the iPhone, Turn it off and again turn it on and reconnect. It worked for me. Sometimes iPhone Debug connection network server clogs up. When you restart iPhone it reinitiate the connection.
This issue keeps happening and it seems like there's a myriad of reasons that may cause it, and so there are a lot of solutions that fixed it for people. Someone even suggested that none of the fixes actually work, and it's only the fact that time passes as we try different solutions that actually fixes it. Nevertheless, I will share what worked for me and what I found so far.
a. In the past, the issue was most often caused for me by using an older version of Xcode with a newer iOS. Apple doesn't always release the version of Xcode that supports the latest iOS at the same time, and this issue sometimes happens as a result of that. There are people who suggest right clicking the Xcode App > Show Package Contents > Developer > Platforms > iPhoneOS.platform > Device Support and renaming the folder for the latest supported version to the one running on the phone (for example renaming 16.0 to 16.1). I've had better luck with using the Beta of Xcode if it's not out yet (in this case using 14.1 RC2 instead of 14.0.1).
b. Incrementing the build number and setting a Display Name. This seems to have fixed the issue after nothing else worked. Again, this seems very random, so it could be unrelated, but it did fix it in my case after nothing else suggested on all the threads about this worked.
c. Deleting the profile in Settings > General > VPN & Device Management
Other suggestions I've seen across threads:
Restarting the device (seems to be the most popular solution)
Unpairing the device
Checking device status under Window > Devices and Simulators. There may sometimes be some further info about what is going on here, the device may still be preparing for development or downloading symbols or whatever
Using another cable. This never worked for me, after trying with 3 cables, 2 from Apple and one 3rd party, but others reported it worked
Deleting Derived Data (use Dev Cleaner or rm -rf ~/Library/Developer/Xcode/DerivedData
Uninstalling the app manually from the device
Resetting Network Settings
Force restarting the iPhone
Apple really needs better errors and less ridiculous bugs like this.
I had to update Xcode to fix this issue because my version of Xcode did not support my up-to-date iOS version.
I've had the same issue and also had the problem that I wasn't able to connect my device by cable (it popped on and of), so I had to use wifi connection on Xcode.
I was able to see the icon of the app created by Xcode on my iOS device, but whenever I tried to start it, it won't do so giving the "Untrusted Developer" error message.
I fixed this by going to:
Settings > General > VPN & Device Management > Developer App
Here you have to chose the App and consent to trusting it.
I reset the iPhone network settings and it works!
I have the same problem, my solution is update my ios version(15.1 to 15.2 beta)
I tried all the resolvent, nothing worked
restart iOS, Xcode, macOS
clear DeviceSupport, Caches
unpair iphone, change lighting cable
Then I find my ios version(15.1) does not exist in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.
I try to fix it, but failed.
Finally, I can only update my iOS device to 15.2 beta version, It solved! Xcode is update to beta version too.
My devices original version:
iOS 15.1
Xcode 13.1 (13A1030d)
I'm on Xcode 13.3 and I fixed this by unplugging and plugging the cable between my MacBook Air and my mini iPad 3.
I fixed it by,
Following the steps : Window > Device and Simulator > Select your device and Right Click on it > Unpair after that re-connect your iOS Device then boom... Clean builds and run the app, it will work for you.
Upon solutions aren't working for me. Restart my iPhone then all well done.

Xcode error: Failed to prepare device for development

I have updated to Xcode 12.3 beta. device version is 14.2, but Xcode complaining:
Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.
Failed to prepare device for development
iPhone directly connected to MacBook.
I have tried all mumbo jumbos on the web. but no success any idea?
Unable to prepare DEVICE for development
Please check the connection to the device, and review all errors in the Devices and Simulators window.
A simple phone restart will fix it
I have had to come back to this SO question twice in the past couple weeks. First time, I did have to update my Xcode and iOS versions, which fixed the issue. Now, the issue has returned, but there are no updates. I tried disconnecting and reconnecting my phone from my laptop, but to no avail.
What fixed it the second time was merely restarting my phone. I am curious if that would have fixed it the first time too, without needing to have updated.
I know this is just echoing the other answers here, but at the very least, I would recommend just starting with a simple phone restart and seeing if that fixes your problem. Here is the specific screenshot that I encountered, in case yours is the same (pro tip: you can open up the "Devices and Simulators" window by going to Window -> Devices and Simulators shift-command-2).
This error shows because of iPhone OS version is not supported by Xcode that's why this warning popped up, so check which max ios version is supported by Xcode which you are using.
In my case, the Xcode version is 13.1 and my iOS version is 15.4 so what I did, First downloaded device support version 15.4 from here (Download according to your device version) and added this to my Xcode.
steps to add the file in Xcode:-
Go to Applications > Right click on Xcode and Select Show Package Contents > Contents > Developer > Platforms > iPhoneOS.platform > DeviceSupport.
Extract your device support file to DeviceSupport Folder.
Restart Xcode and unplug and plug in your device.
Exact same problem here, this solved the issue for me:
Delete the app from the phone
Clean the Build Folder with: ⌘ + shift + K
Delete derived data
Unpair device (from ⌘ + shift + 2 window)
Disconnect iPhone
Restart iPhone
Restart Mac
Trust
After this, it worked for me.
I restarted my iPhone(14.2); now both Xcode 12.3 beta and 12.2 can run app on my device.
I could not get the phone to authorize until I had the paired Apple Watch trust the computer as well.
A more helpful error message could be imagined.
Both the iPhone and the paired Apple Watch must trust the computer before the phone can be successfully prepared for development.
If u are looking this because, your ios 15.7 device (latest for iPdas at the moment) show this error on xcode 14.0 (latest at the moment) it is a bug related with the xcode version.
Check Here.
Update
This issue is fixed in Xcode 14.0.1
In my case was to keep the iOS version with my Xcode version in sync.
Xcode 12.3 with iOS 14.3
What worked for me was to go to Xcode Devices and Simulators window, then ...
right click on the Connected device, and select "Show Provisioning Profiles" menu item, then delete all the provisioning profiles,
right click on the Connected device, and select "Unpair Device" menu item
Unplug and reboot the phone
I tried most suggestions here. The only thing that ended up working was unpairing my phone in Xcode then unpairing my apple watch from my iPhone. Connects just fine now. iOS (14.3) Xcode (12.3)
Thanks Matt for hint:
Updating device iOS to 12.3 beta fixed the problem.
if you updated you iOS to latest beta version, you should also use latest Xcode beta version.
Exact the same problem with Xcode 12.3 beta ; for me, just have to:
Disconnect the phone
Restart the phone still on ios14.2
-> data cable off
-> data cable on
and it works :)
Solution: Update your Xcode to a newer release date than your iOS Release Date.
I experienced this problem when using the iPhone's personal hotspot on my Mac. The fix was to disconnect the phone from the computer, then disconnect from the personal hotspot and reconnect again. Apparently this makes the mac use the wifi hotspot (and not the usb hotspot on the iPhone, which messes things up when debugging).
As many people mentioned/suggested, restarting my iPhone solved the problem.
My setups are: Catalina 10.15.7, Android Studio 4.0, Flutter 2.01,and Xcode 12.4.
I think having an apple watch paired to your iphone causes some issues.
I had trusted from my apple watch, but was still having this issue. Unparing my apple watch from my iphone was the only thing that worked for me:
unpair apple watch from iphone
unpair iphone from xcode
Restart both, and don't pair apple watch until the iphone is paired.
and, if you have any other problems, and are using flutter, run flutter doctor, and ensure you have cocoapods installed.
and once again, if Flutter issues, follow the details here to ensure you have your signing setup correctly
also, if things aren't working, then do a flutter clean, and then try again.
Updating Xcode is a fix because old versions of Xcode can't talk to new versions of iOS (see https://developer.apple.com/support/xcode/ for compatibility).
If you're stuck on an old version of Xcode you can use something like https://github.com/iGhibli/iOS-DeviceSupport or https://github.com/filsv/iPhoneOSDeviceSupport which installs the newer device support files into older versions of Xcode.
I just solved my issue removing the iPhone cable and putting it back.
This solved the issue for me:
Delete the app from the phone
Clean the Build Folder with: ⌘ + shift + K
Unpair device ⌘ + shift + 2
Disconnect iPhone
cmd + shift + 2
Click the red cross to check error detail
In most cases, the error message shows your xcode supported iOS version is lower than your iPhone's iOS version.
Update your xcode.
In my case, after updating iPhone to a newer iOS version then got this issue.
The solution is needed to update XCode to the latest version and everything is ok.
If other answers don't work, try updating Xcode.
For me I was using Xcode 14.0.0. The release notes for 14.0.1 say
This update fixes an issue that prevents development with devices running iOS 15.7.
Indeed my phone is on iOS 15.7.
Nothing from the above listed helped me and also I have encountered this problem when the app was removed for a while. But turning off the phone for 10 mins solved the problem.
My Current Setting and Versions:
XCode 12.4 and iOS 14.4
I had to update XCode since my iOS was updated. This fixed the compiler error in Unity and then the same message popped up during deployment. All I did was disconnect/re-connect.
Restarting the iPad works for me every time!
We encountered this error and determined it was due to a damaged iPhone cable. New cable, problem solved.
I just had to unpair the phone from Xcode's Devices and Simulators screen and then tap Trust when connecting it to the computer to make my Watch work with Xcode
I had to change the iOs Deployment target to "iOs 15". Then it worked. After that, I just set it back to iOS 12, and everything keeps working.
If nothing worked for you, try the below steps.
Update the Xcode
Update the iOS version
Connect mac and iPhone to the same wifi
just Clean the Build Folder with: ⌘ + shift + K

dyld_shared_cache_extract_dylibs failed for iPhone XS Max running ios 12.1.2

I am trying to run my app on iPhone XS Max running iOS 12.1.2, but till the end of the build and it returns "dyld_shared_cache_extract_dylibs failed" , i removed the supported files for it and rerun my app and it gives the same error , any suggestions i'm stuck ?????
There is a (temporary) solution I've been using...
Open Devices and Simulators
Remove your device from the list
Tap the + button on the bottom left of the window
Select the device (before tapping Trust on it)
Tap Trust on the device
Profit
For me I still have to do this steps every time I connect the device...
I have both Xcode10.3 and Xcode11.2.1 installed on same machine. Whatever solution I try, it doesn't work with Xcode10.3 and iPhone11. It works like a charm on the latest Xcode though. I think the solution is to switch to the latest Xcode version.
I recently solved this issue by installing Xcode 11.2 and 10.1 alongside each other, and using Xcode 11.2 to build the debugger files. It seems 10.1 can't handle newer versions of iOS and builds the debugger support files incorrectly.
Delete everything under ~/Library/Developer/Xcode/iOS DeviceSupport/ related to the version of iOS giving you trouble. This is where Xcode saves the debugger support files. Then launch Xcode 11.2 with the phone connected and allow it to build the debugger support. After it has finished, close it and open Xcode 10.1 and it should work.
i tried everything and my solution was go to app store and download again xcode, he is going to updated by self
try Run it in latest Xcode version then try again in the version you want
and try to reboot the mobile device and unpair it and connect it again thats worked for me
BTW thanks #unstablerealtiy

iPad is not showing in Develop menu on OSX Safari

I need to debug an HTML app on ipad. I used to be able to connect ipad by USB cable to my mac and it would show in the "Develop" menu in Safari. I have two ipads now - one with iOS 6 and another with iOS 7. The iOS 6 one is showing correctly and I can access the web inspector from my mac. iOS 7 ipad is not showing in the "Develop" menu.
I have the latest version of iOS installed (version 7.1) and the latest version of Safari (7.0.2) on Maverick.
Any suggestions are welcome.
Enable web inspector on your iOS device by following these steps:
iOS Device > Settings app > Safari > Advanced > Web Inspector
This setting allows you to connect to safari on your desktop.
I know this is a little late. I had this same issue and figured I would post how I got it to work in my case just in case it helps anyone in the future. I enabled it on the iPad and it didn't show. I tried closing Safari on the iPad, disconnecting and reconnecting the cable and neither worked. It ended up for me being really simple, I just quit of Safari on my laptop and restarted it and Safari then recognized the iPad and allowed me to debug. This may not work for every case but it did for me, hope it helps.
edit: just a note, I had the iPad plugged in with web inspector enabled when I restarted Safari.
In my case I was running iOS 11 BETA on the iPhone, and was trying to access from Safari 10 (current stable version). I have installed Safari 11 BETA, and now it is working as expected.
So in general: Make sure you are running the latest version of Safari. And if you are testing on iOS BETAs, you can download Safari Betas & Safari Technology previews from here (Thank you for the link #Jacob Ford).
You also need to enable web inspector from the device.
Open the settings app, select safari, select advance and then turn on web inspector.
ref:
http://www.spiraltrack.com/blog/how-debug-iphone-and-ipad-web-applications-using-safari.
Using a genuine Apple lightning cable (instead of a fake one) solved my problem.
After all these years, I finally found out what the problem was! Apparently, Safari version on the Mac needs to be the same or newer than the version on the iPad. If iPad has a newer version than Mac, then it won't be visible. If Mac has the same or newer version, then iPad is visible and can be debugged.
I wish Apple had documented this anywhere - would have saved loads of time for a lot of people.
One more tip to try - after trying many of the above suggestions I turned off "Sync with this iPhone over Wi-Fi" in iTunes.
Voila! Got my iPhone into the Develop menu!
(for context, this is in Mojave 10.14.6, iOS 13.1.3, Safari 13.0.3)
I just had to toggle the web inspector on and off on the device I was trying to connect and it showed up under Safari's develop menu:
iOS Device > Settings app > Safari > Advanced > Web Inspector
If you already have enabled web inspector on your iOS device by following these steps and still it is not showing you can try just disabling and then again enable web Inspector in device's Safari browser.
iOS Device > Settings app > Safari > Advanced > Web Inspector
Had the same issue after updating to Safari 13 and Xcode 11.3 on macOS Catalina. For me the following change brought the iOS device back to Safari's Develop menu:
Connect the device via USB
Start Xcode and go to menu "Window > Devices and Simulators"
Select the device
Check the "Connect via network" option
I've tried all the above but the only thing that works for me is to put iphone/ipad in airplane mode and then unplug/plug in the lighting cable a few times while keeping the develop menu open, once it shows up you can then turn off airplane mode
Another gotcha for the basket: If you've another OS running in a virtual machine that you've forgotten about then the iPad can end up connected to that and hence invisible to Safari on the Mac.
Additional go to:
Device Settings -> Safari -> Private Browsing = OFF
For me, the problem was the different OS versions between the iPad and the iMac. I updated the iPad with the latest OS (iOS 11.2.2 at the time of this writing), but the iMac was under El Capitan (10.11.6) macOS. Once I updated the iMac to High Sierra (10.13.2) everything worked correctly.
I've found that Simulator is always in Safari's Develop menu if it's already running when Safari launches, and Simulator is never in the menu if Safari is launched first.
So you need to restart your Safari again.
That's Simulator 11.2 (comes with Xcode 9.1), Safari 11.0.3 and macOS 10.13.3
Similar to what BernieSF said, with a little more detail from my specific scenario. I was getting ready to upgrade my laptop to High Sierra to try and solve this, but I'm glad I didn't have to.
I have been trying to solve this for some time now, so maybe my situation will apply to someone else. The problem was the version of Safari I had installed on my older Macbook Air.
Symptoms: All the appropriate settings were enabled, and when I plugged in my phone to the USB cable, it would show up in the Develop tab, and then quickly disappear.
Setup: iPhone 7 on 11.3.1 and Macbook Air(3,2) on 10.12. On the Air, Safari was version 10.1.
I read in an Apple thread that for iOS 11, I needed to have Safari 11, but I had no option to update Safari in the App Store. There was a system update available, and the update to 10.13 available, but not Safari.
Solution:
I did the system updates (not the update to 10.13)
After my computer rebooted, the App Store then offered me an update to Safari 11.1.1 and I installed that
Voila! It now works!
I had this issue with iOS 13.2.3 on both macOS Mojave and Catalina.
When I disconnected the iPhone from the Wi-Fi and only connected it via the cable the dropdown in Safari showed the iPhone.
The solution for me was:
In iTunes click the sync-settings button and enabling and then disabling the "Sync with this iPhone over Wi-Fi".
After that the iPhone showed up again in Safari's developer menu.
I experienced the same issue today with iOS 13 and Mac OS 10.14 (Mojave).
What fixed it for me was simply installing a required Update in MacOS.
However, it is not an update that is installed via system preferences but only via a dialog that appears when trying to connect the devices.
Unfortunately the dialog appeared behind all other windows and could not be tabbed to. Thus I did not see it at all until I closed all other windows.
Regarding the dialog itself - here some information from Apple support:
https://support.apple.com/en-us/HT208831
In my case, I was using iOS beta version.
Xcode > Window > Devices and Simulators > Connect via network
then I can see error messages.
"The current device configuration is unsupported. This iPhone X (Model A1865, A1901, A1902,…"
"To run on this device, please update to a version of Xcode that supports iOS 13.6. You can download Xcode from the Mac App Store or the Apple Developer website."
Oh yeah.
Another thing to check is Build Settings > Signing > Code Signing Identity
Make sure both Release and Debug are set to iOS Developer

Safari crashes instantly when trying to debug iPad Simulator app

I realize that this is a long-shot... but I'm looking for tips or advice on how to prevent or debug this issue.
If I start my app in the iPad simulator (webapp using phonegap), then start Safari and select Develope->iPad Simulator->index.html - Safari immediately crashes. The odd thing is that I'm one of several developers working on this app... and we all have seemingly identical setups - yet this doesn't happen for them. They are able to debug in Safari as expected. I should also mention that the app itself works great in the simulator.
Software involved:
Xcode 4.6.2
Safari 6.0.5
Running simulator for iPad 6.1
Again, I realize that this isn't much to go on. Hoping someone might be able to point me in the right direction to figure it out.
SOLVED!
On a whim I blew away the directory for the app in:
~/Library/Application Support/iPhone Simulator/6.1/Applications/
and Voila - debugging in Safari works again - doesn't just crash-on-load!
For those people finding this with a more recent version of Mac OS and Xcode/iOS Simulator, this fix worked for me as well:
Mac OS version: 10.12.6
iOS Simulator version: 10.0
Open up iOS Simulator.
On the menu bar go to Hardware > Erase All Content and Settings > Reset.
Restart your Mac
Should be back up and running after that.

Resources