Where are iOS simulator files? - xcode

So because of the poor internet connect I have in China, I downloaded iOS 9.3 simulator SDK from here via multithreads web connection: devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg
After installation the simulator doesn't show up in my hardware (Xcode menu), so I guess it wasn't compatible with the newest Xcode 8.3.2, yet it does take up additional 3.6 GB storage space of my laptop (of which only has 9 GB left right now). I then left the laptop on and downloaded the SDK from Xcode directly and installed it successfully, the problem is that it didn't remove the 3.6 GB files from previous installation so now I have less than 1 GB left on my laptop. I like to find out where the SDK is and manually remove them to free up storage space on my laptop.

/Library/Developer/CoreSimulator/Profiles/Runtimes

In 2021 onwards, the device emulator files be found at ~/Library/Developer/CoreSimulator/Devices/, but this contains all simulators installed, which is currently 24 devices on my machine.
~/Library/Developer/CoreSimulator/Devices/$DEVICE_ID/data/Library
To find out your simulator device id:
Launch your simulator
xcrun simctl list 'devices' 'booted'
== Devices ==
-- iOS 14.4 --
iPhone 12 Pro (1320D7BA-FB2E-4E1C-834B-09BE5031054B) (Booted)
iPhone 12 Pro Max (91512DCC-DCEA-4ED4-9731-52D895399940) (Booted)
-- tvOS 14.3 --
-- watchOS 7.2 --
cd /Users/username/Library/Developer/CoreSimulator/Devices/91512DCC-DCEA-4ED4-9731-52D895399940/data would contain these files:
Extra: how to get a Application.app to run on simulator
For example, you could take this app and share it with someone else.
cd /Users/username/Library/Developer/CoreSimulator/Devices/emulator_id/data/Containers/Bundle/Application/
ls # This will list all the application directories, where each directory contains a `.app` file which will work on emulators.
You can drag this .app file onto another simulator and it will install.

You can use Disk Inventory X Application to spot large files in your mac. It is very useful to remove and free up some space.
Anyway, answering your question, the simulator files is in /Users/[Your user account name]/Library/Developer/Xcode/iOS
you should be able to find those unused file there

The best way to deal with this problem, is using an app called DaisyDisk, because XCode download new simulators every time iOS update, today you have iOS 10.3.x, even you delete those, XCode will download iOS 10.4.x or iOS 11 again in the future, you'd have to manually delete those files again.
Using DaisyDisk makes discovering these simulators, as well as deleting them fairly easy, I strongly recommend you to try it.
Bravo Apple for making 128G Mac users suffer :)

Related

How to run multiple simulators on Xcode 12 and 13?

I've seen this post for running multiple simulators on Xcode 9: How to run multiple simulators on Xcode 9?
The working solution was to go to Hardware > Devices and choose a simulator from there. But I'm currently using Xcode 13 and many developers may have the same version now. In version 12^/13, we won't find Hardware up top. So how do we run another simulator from there?
In order to open another simulator, you'll need to go to File > Open Simulator and then choose from the devices there like this:
You're all set! I just want to share this to everyone to help save their time and avoid getting headaches (like what I've experienced) just to run another simulator on Mac.

Failed to start remote service on device problem in xcode

I create a flutter app and now I'm trying to run it through XCode on my real iPhone, but after the installation finishes, I face the following problem:
Also with I trying to run the application on my real phone, after clicking on the application icon, I face a white screen appears, and then the application closes directly.
Catalina 10.15.3
IOS 14.2
XCODE 11.7
Also I was make a trust to app in phone
Does anyone know the reason for this problem?
This problem maybe because of two reasons:
First: Xcode 11.7 doesn't have support files for iOS 14 you can download it from here https://github.com/filsv/iPhoneOSDeviceSupport
Second: I have this problem now and I couldn't fix it.. but I have iPhone with iOS 14.2 and iPad with iOS 14 so the problem was just on the iPhone but after I updated the iPad with iOS 14.2 it happened with it.. so the problem maybe because of the iOS 14.2 so we have to wait for the update or because of the Xcode 11 version and we have to download the Xcode 12 version..
I hope we can find a solution quickly...
make sure to have the latest system update on your target device and the latest Xcode version as well. The error should disappear.
Best,
Ralf
I have fixed the problem by using the above solution but it has happened again. So, I have followed these instructions and fixed again:
https://stackoverflow.com/a/61665031/6586109
A good first place to look is Window > Devices & Simulators in xCode, then find the details for your device. There may be error information here that helps you find the fault.
Restarting devices and installing updates seem to fix this problem for a lot of people.
For me, there was a red notice in the device window about connection to the device and it turned out to be the cable that was at fault.
This was an official Apple cable, just a few months old, and still works fine for charging and data transfer; and I've been using it with xCode without problems for a couple of months. It seems to be possible for Apple cables to develop some tiny physical fault that seemingly only xCode is sensitive to.
Using a different cable worked first time for me.
There seem to be a few variations on the exact error message with the same root causes varying depending on exactly what xCode was trying to do at the exact moment it failed: I'm on xCode 12 and for me it was:
Failed to start remote service on device
Failed to start remote service com.apple.installation_proxy on device

When I attached my device to the xcode and try to build my project it's generating error

Could not locate device support files.
This iPhone 5s (Model A1457, A1518, A1528, A1530) is running iOS 10.3.1 (14E304), which may not be supported by this version of Xcode.
You need to update Xcode whenever the iOS version you want to work with is higher than the highest version that Xcode's simulator has installed. This can be done one of two ways. The simplest is to use the App Store to download/update Xcode. If the App Store doesn't show any updates, you must manually download the latest Xcode build from https://developer.apple.com/.
You will need to manually download from the Developer portal when the version of Xcode on your computer was downloaded there previously. For example, many beta testers may download the file directly instead of using the Mac App Store, since it is a beta download.
I would recommend trying to keep updates done through the App Store by downloading Xcode from there initially. The benefit to this is that it can automatically update as well as save space on your computer (Xcode is a big file, and you may not have enough space to download a new version if you still have the old version).
As of the comments, I will now write an answer. :-)
Whenever you encounter this error there might be two reasons for that:
The OS version is too old
The iPhone's/iPad's OS is too new for your Xcode version
If it is too old, you may need to download older SDKs and OS versions.
You can do so in Xcode. Go to "Preferences" -> "Components" and download the appropriate Simulator.
If the devices OS is up to date, you have to make sure your Xcode is also up to date.
Either you update Xcode through the AppStore OR (and I prefer this way, as the AppStore is used to hang up in a certain state and cannot be completed any longer until you restart the Mac, at least I had this several times).
Side note: Xcode requires multiple GB of free storage. Make sure you have enough free storage left for an update.
You can download the latest Xcode version from the https://developer.apple.com portal:
Go to Downloads:
And then select the item of interest (in your case Xcode)

Xcode 6.0 taking forever to archive my project

Xcode 6.0 taking about 8 hours to archive a fairly large project! Any idea how to make the archiving project faster? The archiving just gets stuck for hours at compiling 42 of 42 source files. Also, sometimes Xcode just crashing after hours of attempting to archive.
I recently upgraded my Mac to a 2.3GHz quad-core Intel Core i7 processor and 16GB RAM, but unfortunately that didn't help. I want to understand if it is a PC configuration issue or an Xcode issue. In other words, if I upgrade to a Mac Pro, would that help?
Try to cancel archive, restart and try again.
If this doesn't work use other old method.
Build you project. Go to left pane-> product ->here you will see .app.
Show in finder .app file under product folder, drag and app in .app in iTunes.
There you will see you app in iTunes, again show in finder and you will see ipa file.

Resetting Xcode's device/version list to run

I want to test/run my app on different iOS versions in Xcode, but somehow I can't see any option to change iOS simulator version (I have both 6 and 7 SDK/Simulator installed) in run targets. I'm also seeing all of my attached devices twice (I have only ONE iPod, but when I connect something else, they all display twice):
There's probably a bug with the device list of Xcode. How can I reset this list? I've tried resetting the scheme, but scheme is project related anyway. The problem occurs in all projects, not only a single project.
First of all, you have to install the 6.1 Simulator.
After that, you can choose which simulator version to use:
I've figured out the problem. I was on the "Latest iOS SDK" which was 7.1 SDK (I also have XCode 5.1DP installed). I've changed the base SDK to 7.0 and I am again able to choose. I still have two entries for each physical device but I can live with that.

Resources