diff --git a/vitepress/.vitepress/theme/custom.css b/vitepress/.vitepress/theme/custom.css index cce2961..3f3c9c9 100644 --- a/vitepress/.vitepress/theme/custom.css +++ b/vitepress/.vitepress/theme/custom.css @@ -52,3 +52,17 @@ kbd { .custom-block:target { outline: currentColor solid; } + +/* Make element only visible under specific conditions */ + +@media not (prefers-color-scheme: dark) { + .only-when-dark { + display: none; + } +} + +@media not (prefers-color-scheme: light) { + .only-when-light { + display: none; + } +} diff --git a/vitepress/articles/macos-sonoma-download-xcode-simulators-slow-bandwidth.md b/vitepress/articles/macos-sonoma-download-xcode-simulators-slow-bandwidth.md new file mode 100644 index 0000000..7843779 --- /dev/null +++ b/vitepress/articles/macos-sonoma-download-xcode-simulators-slow-bandwidth.md @@ -0,0 +1,85 @@ +--- +title: Downloading Xcode Simulators on macOS Sonoma when the bandwidth is slow +description: It shouldn’t be a pain in the ass, but it is. +tags: ios-simulator, xcode, safari, macos, apple, bandwidth +publishedAt: 2023-11-18 +outline: [2, 3] +--- + +Since [macOS Sonoma](https://www.apple.com/macos/sonoma/) (codename for macOS 14), [Xcode](https://developer.apple.com/xcode/) doesn’t include any iOS Simulator anymore, so it’s now 50% lighter to download (3.2 GB instead of 7 GB), which is nice… except when your bandwidth sucks. + +--- +# Downloading Xcode Simulators on macOS Sonoma when the bandwidth is slow + + + +There’s one question you might have before we jump in: + +> I’m a web developer, should I care about the iOS Simulator? + +Yes! If you are doing web development and wonder if you should install the iOS Simulator, jump to the [last section](#what-are-xcode-simulators-by-the-way). + +## How to download the iOS Simulator + +### Fail: the traditional way + +On macOS, you would normally open Xcode and hit the “get” button from _Settings_ / _Platforms_. + + + + + + Xcode platforms settings, showing available platforms (macOS, iOS, watchOS, tvOS). + + +My connexion is slow and peak at 21 Mbps (2.6 MB/s.), and downloading from that menu is more often in the 0.1 to 1 MB/s range, and even worse: it will fail after around 2 hours **with no possibility to resume the failing download**! + +### Fail: same player try again with the command line + +Alternatively, the download can be triggered from the command line: + +```sh +xcodebuild -downloadPlatform iOS +``` + +But unfortunately, it’s as slow as a download from the Xcode app, and you’ll get kicked out the same way after a while without the ability to resume the download. At least the experience is consistent… + +### Success: use Safari + +Fortunately, along with the [previous method documentation](https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes#Install-and-manage-Simulator-runtimes-from-the-command-line) comes a way simpler way to proceed: go to the [Apple developer downloads website](https://developer.apple.com/download/all/?q=ios%20Simulator%20runtime) (you have to login with an Apple ID) and download the Simulator runtime `.dmg` file directly from Safari: the download was way faster for me, and it can be resumed if it fails (it did not for me but I checked, for science and for you 😘). + +Once you have downloaded the simulator file, add it to Xcode with this command (make sure to check the file path): + +```sh +xcrun simctl runtime add iOS_17.0.1_Simulator_Runtime.dmg +``` + +The command should take around 20 seconds to run. Now you can open Spotlight and type _Simulator_. + +w00t! Another dumb mystery that should not exist is now solved. 💁‍♂️ + +## What are Xcode Simulators, by the way? + +One of the benefits of using a Macbook is that you get access to Simulators for the whole Apple ecosystem through Xcode. + +Simulators allow you to test how your websites or in-development native apps behave on any iPhone and iPad without the need to purchase the devices. Using Simulators doesn’t replace the experience of having your fingers on the real devices, but they are very good and you should definitely use them. + + + + + + Simulator showing an iPhone SE (3rd generation) using iOS 17.0. The About page of Mehdi Merah’s blog is displayed in Safari. + + +Simulators are handy, robust and come with a good set of features, like the ability to use Safari macOS developer tools to inspect any Safari iOS tab. There’s an Apple WWDC 23 video about it ([from 6:42](https://developer.apple.com/videos/play/wwdc2023/10262?time=402) to 8:45). + +:::details Screenshot of Safari iOS inspected from macOS. + + + + + Simulator showing an iPhone SE (3rd generation) using iOS 17.0. Next to its window is Safari macOS developer tools, with the element and styles panes visible. + + +View this screenshot in a new tab in light mode ([WebP](../public/content/ios-simulator-safari-light.webp), [PNG](../public/content/ios-simulator-safari-light.png)) or in dark mode ([WebP](../public/content/ios-simulator-safari-dark.webp), [PNG](../public/content/ios-simulator-safari-dark.png)). +::: diff --git a/vitepress/notes/2023-11-18-macos-sonoma-downloading-ios-simulator-is-now-complicated.md b/vitepress/notes/2023-11-18-macos-sonoma-downloading-ios-simulator-is-now-complicated.md new file mode 100644 index 0000000..2a7c5f0 --- /dev/null +++ b/vitepress/notes/2023-11-18-macos-sonoma-downloading-ios-simulator-is-now-complicated.md @@ -0,0 +1,14 @@ +--- +title: It used to be simple to download the iOS Simulator +description: Three ways to download the iOS Simulator on macOS Sonoma, but only one works when your bandwidth sucks. +publishedAt: 2023-11-18 +excerpt: There are three ways to download the iOS Simulator on macOS Sonoma, and [only one works when your bandwidth sucks](). +--- + +# It used to be simple to download the iOS Simulator + + + +The only benefit of having a bandwidth that sucks (thanks Proximus, everyone hates you!) is that you can experience the suffering of your end users before they do, and observe how a ton of websites behave in sub-optimal situations, so that you can learn a bit about web performance and consider [what makes sense for your website](https://adamsilver.io/blog/in-defence-of-graceful-degradation-and-where-progressive-enhancement-comes-in/). + +That’s it, everything else sucks. Now, [even downloading the iOS Simulator needs a PhD](../articles/macos-sonoma-download-xcode-simulators-slow-bandwidth.md). diff --git a/vitepress/public/content/ios-simulator-safari-dark.png b/vitepress/public/content/ios-simulator-safari-dark.png new file mode 100644 index 0000000..f15a688 Binary files /dev/null and b/vitepress/public/content/ios-simulator-safari-dark.png differ diff --git a/vitepress/public/content/ios-simulator-safari-dark.webp b/vitepress/public/content/ios-simulator-safari-dark.webp new file mode 100644 index 0000000..5605fdf Binary files /dev/null and b/vitepress/public/content/ios-simulator-safari-dark.webp differ diff --git a/vitepress/public/content/ios-simulator-safari-light.png b/vitepress/public/content/ios-simulator-safari-light.png new file mode 100644 index 0000000..383b307 Binary files /dev/null and b/vitepress/public/content/ios-simulator-safari-light.png differ diff --git a/vitepress/public/content/ios-simulator-safari-light.webp b/vitepress/public/content/ios-simulator-safari-light.webp new file mode 100644 index 0000000..a181b4d Binary files /dev/null and b/vitepress/public/content/ios-simulator-safari-light.webp differ diff --git a/vitepress/public/content/simulator-mehdi-blog-dark.png b/vitepress/public/content/simulator-mehdi-blog-dark.png new file mode 100644 index 0000000..a63f865 Binary files /dev/null and b/vitepress/public/content/simulator-mehdi-blog-dark.png differ diff --git a/vitepress/public/content/simulator-mehdi-blog-dark.webp b/vitepress/public/content/simulator-mehdi-blog-dark.webp new file mode 100644 index 0000000..e884433 Binary files /dev/null and b/vitepress/public/content/simulator-mehdi-blog-dark.webp differ diff --git a/vitepress/public/content/simulator-mehdi-blog-light.png b/vitepress/public/content/simulator-mehdi-blog-light.png new file mode 100644 index 0000000..e58a59e Binary files /dev/null and b/vitepress/public/content/simulator-mehdi-blog-light.png differ diff --git a/vitepress/public/content/simulator-mehdi-blog-light.webp b/vitepress/public/content/simulator-mehdi-blog-light.webp new file mode 100644 index 0000000..a2304c1 Binary files /dev/null and b/vitepress/public/content/simulator-mehdi-blog-light.webp differ diff --git a/vitepress/public/content/xcode-settings-platforms-dark.png b/vitepress/public/content/xcode-settings-platforms-dark.png new file mode 100644 index 0000000..93500e9 Binary files /dev/null and b/vitepress/public/content/xcode-settings-platforms-dark.png differ diff --git a/vitepress/public/content/xcode-settings-platforms-dark.webp b/vitepress/public/content/xcode-settings-platforms-dark.webp new file mode 100644 index 0000000..7cd6b9f Binary files /dev/null and b/vitepress/public/content/xcode-settings-platforms-dark.webp differ diff --git a/vitepress/public/content/xcode-settings-platforms-light.png b/vitepress/public/content/xcode-settings-platforms-light.png new file mode 100644 index 0000000..2108826 Binary files /dev/null and b/vitepress/public/content/xcode-settings-platforms-light.png differ diff --git a/vitepress/public/content/xcode-settings-platforms-light.webp b/vitepress/public/content/xcode-settings-platforms-light.webp new file mode 100644 index 0000000..8e1cdb5 Binary files /dev/null and b/vitepress/public/content/xcode-settings-platforms-light.webp differ