After I downloaded Xcode 15, I use the following approach to download and install iOS 17 simulator:
-
Download iOS 17.0 simulator runtime from Apple website
-
Then run xcrun command to install it:
$ xcrun simctl runtime add iOS_17_Simulator_Runtime.dmg
(BTW, I can't install iOS simulator from within Xcode directly because downloading the image always failed. I have a fast Internet connection. The issue seems to be intermittent connection failure.)
The iOS simulator was installed successfully. However, I find the behavior of xcrun command is very confusing. Below is what I observed.
First this is xcrun command output:
$ xcrun simctl runtime add iOS_17_Simulator_Runtime.dmg
D: EEF873B8-E0E6-4A0E-9A1E-C4C7E6D3BE1A iOS (17.0 - 21A328) (Ready)
I suspect the output means it mounted the img somewhere. However, I can't find that disk in Finder. I checked the manually page and found the following:
add <path> [-ma]
Add a runtime disk image to the secure storage area. The image will be staged, verified, and mounted.
When possible the image file will be cloned so no additional disk space will be used.
If stdout is a terminal and a copy is required then progress will be reported.
I wonder what's that "secure storage area"? Is that the reason why I can't see the disk?
What's more confusing is that, shortly after the xcrun command completed, a GUI message box popped up, displaying a messsage "Verifying iOS 17.0.simruntime". This took a while. Then the message box disappeared and nothing more happended. At this time I opened Xcode and verified iOS similator was installed indeed.
I monitored disk IO during the entire process. I observed a lot of read ops but few write ops, which is odd. I understand why there were many read ops, but I expected the same amount of write ops also. Is it due to COW, plus the fact that the image is mounted rather than uncompressed?
The manual says "The image will be staged, verified, and mounted." I wonder what does "staged" mean in this case? Also, the mannual says the image is mounted. So my first thought was that I shouldn't move or delete the image file I downloaded. Then I noticed the manual also says "When possible the image file will be cloned so no additional disk space will be used." So I think it's OK to delete the image file? I'd like to confirm my understanding first so I haven't tried it yet.
Thanks for any explanation.