Don’t charge your MacBook Pro from the left side. Use the right side.

Ever since September 2019 I had this issue with my MacBook Pro where kernel_task would sometimes spike up to > 1000% (!) CPU load and drain my battery – even while connected to a charger.

Upon disconnecting the charger, the load would drop back to normal levels. But on reconnecting kernel_task would be at it again.

~

A few weeks ago I saw this tweet float by:

And yes, that totally explained my problem. As the linked StackExchange thread mentions:

High CPU usage by kernel_task is caused by high Thunderbolt Left Proximity temperature, which is caused by charging and having normal peripherals plugged in at the same time.

So the fix is simple: don’t charge your MacBook from the left side but use the right side.

Now this is not something I’d expect from a +$3000 costing machine but as the late Steve Jobs would say: “You’re holding charging it wrong” … ¯\_(ツ)_/¯

In Apple’s support article on it the function of kernel_task itself is explained in detail:

One of the functions of kernel_task is to help manage CPU temperature by making the CPU less available to processes that are using it intensely. In other words, kernel_task responds to conditions that cause your CPU to become too hot, even if your Mac doesn’t feel hot to you. It does not itself cause those conditions. When the CPU temperature decreases, kernel_task automatically reduces its activity.

So it’s basically kernel_task trying to steal CPU cycles from other processes, so that those processes don’t overheat the system.

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

Installing old OS X versions: fixing “OS X could not be installed on your computer”

Here in Belgium schools are locked down due to #coronavirus. With the school of my two oldest kids now switching to remote teaching, I took the time to set up my old MacBook Pro (model late 2008) for my two oldest kids to use. That didn’t go without any hiccups though: the OS X installer refused to install …

The MacBook I had shelved a long time ago was still running OS X Mavericks. As that version was quite showing its age – and didn’t seem to support 2FA for use with my Apple ID – I decided to upgrade it to El Capitan, of which I still had the installer app lying around. I opened up the installer, it prepared some things, and nicely asked to reboot. Upon reboot the installer was ready to install, but when actually starting it greeted me with this error message:

OS X could not be installed on your computer.

No packages were eligible for install. Contact the software manufacturer for assistance. Quit the installer to restart your computer and try again.

Uhoh! Restarting the MacBook, as suggested, did nothing: the installer kept showing that same error message. Trying to change the startup disk to get back into Mavericks (by pressing ⌥+R upon starting the machine) also didn’t help, as I could only launch the installer and a recovery partition. Yes, the machine was actually stuck in a loop where it would only launch the installer and the installer wouldn’t install.

~

With a Google Search Coupon in hand I found that the installer refuses service because the certificate it was signed with (some time back in 2015, when El Capitan was released) got expired by now.

Thankfully one can easily circumvent this expiration by simply changing the date of your system. You can do this before starting the installer, or through a Terminal if the installer is already loaded (as it was in my case).

  1. In the OS X Installer, choose Utilities > Terminal.
  2. Enter date 020101012016 and press Enter.
  3. Quit Terminal and reboot to retry the installation.

💡 In this particular Terminal you’re running as root, so no need for sudo here 😉

Here the date is being set to Feb 1st, 2016. You might need to tweak the date a bit depending on when you downloaded the installer originally (as it might be signed with a different certificate). Be sure to set it no earlier than the release date of the OS X version you’re trying to install.

💡 The syntax for the date command is a bit counterintuitive. Choosing your own date will require some puzzling from your end:

date [-jnu] [[[mm]dd]HH]MM[[cc]yy][.ss]

   cc      Century (either 19 or 20) prepended to the abbreviated year.
   yy      Year in abbreviated form (e.g., 89 for 1989, 06 for 2006).
   mm      Numeric month, a number from 1 to 12.
   dd      Day, a number from 1 to 31.
   HH      Hour, a number from 0 to 23.
   MM      Minutes, a number from 0 to 59.
   ss      Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds).

~

Later versions of OS X, such as High Sierra, have become a bit smarter: they give you the warning upfront – when first launching the Installer.app – instead of after having prepared your disk for installation.

~

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

New WebKit Features in Safari 13.1

This year’s spring releases of Safari 13.1 for macOS Catalina, iPadOS, iOS, and watchOS bring a tremendous number of WebKit improvements for the web across Apple’s platforms. All of this with many more updates for improved privacy, performance, and a host of new tools for web developers.

These features stand out to me:

  • Pointer and Mouse Events on iPadOS
  • Web Animations API
  • Async Clipboard API
  • JavaScript Improvements: String.prototype.replaceAll() and Nullish Coalescing (??)
  • ResizeObserver
  • HTML enterkeyhint Attribute
  • Media APIs: Picture-in-Picture API and Remote Playback API
  • Subtitles and Captions

Great to see things like ResizeObserver finally make it into Safari. The Web Anmations even have gotten their own entry on the WebKit Blog.

~

The enterkeyhint attribute is something new to me. As the spec states, it allows you to set the word to be used on the enter button on virtual keyboards:

The enterkeyhint content attribute is an enumerated attribute that specifies what action label (or icon) to present for the enter key on virtual keyboards. This allows authors to customize the presentation of the enter key in order to make it more helpful for users.

Allowed values are:

  • enter: Typically inserting a new line.
  • done: Typically meaning there is nothing more to input and the IME will be closed.
  • go: Typically meaning to take the user to the target of the text they typed.
  • next: Typically taking the user to the next field that will accept text.
  • previous: Typically taking the user to the previous field that will accept text.
  • search: Typically taking the user to the results of searching for the text they have typed.
  • send: Typically delivering the text to its target.

~

New WebKit Features in Safari 13.1 →
Web Animations in Safari 13.1 →

“But Apple does it that way”

Adrian Roselli:

It is not uncommon that I raise an accessibility or usability issue with a client’s design or implementation and am met with either “But Google does this”, or “But Apple does this.” Mostly it is the default response to any issue I raise, but it is far worse when it is a reaction to a genuine technical failure or problem real users have identified.

That response does not address the problem I may have raised. It avoids. It offloads responsibility. It declines to even try.

As Jeremy Keith put it:

Cargo cultism is not a strategy.

I Don’t Care What Google or Apple or Whoever Did →

Six professionals review the Mac Pro

I like this review of the Mac Pro by The Verge. Very nuanced, something you don’t come by often these days.

In short: It’s a hell of a machine which costs a ton. Adobe’s software is not taking advantage of all of the machine’s power. The XDR Display might or might not work for you.

Mac Pro review: the price of power – The Verge →

Prevent Apple’s “double key press” on the butterfly keyboard with Unshaky

If you’re having this “double key press” issue, Unshaky is a software solution that will help you get by.

Unshaky tries to address an issue on the butterfly keyboard (Macbook, Macbook Air 2018 & MacBook Pro 2016 and later): Double Key Press. Unshaky might save your keyboard by dismissing such “second key hits” (any key presses that occur no later than x milliseconds after the previous effective one).

Installable through Brew Cask, or per direct download from the site:

brew cask install unshaky

Won’t fix the fact that the keyboard doesn’t sit well on the fingers …

Unshaky: A software attempt to address the “double key press” issue on Apple’s butterfly keyboard →

🚨 As Apple has acknowledged these issues, don’t forget to apply for Apple’s Keyboard Service Program for MacBook and MacBook Pro to get a new keyboard, free of charge.

Stop Apple Spotlight from slowing down your Mac by preventing it to index node_modules folders

Speaking of node_modules folders, this tip by Roel Van Gils came to mind:

Hat tip, Roel! But wait dear reader, there’s more …

~

In case you want to retroactively add .metadata_never_index files to your node_modules folders, use this command as suggested by @malfaitrobin (a former student of mine):

$ find . -type d -name "node_modules" -exec touch "{}/.metadata_never_index" \;

You might need to reindex Spotlight after this before it takes effect:

$ sudo mdutil -i on /

~

To stay ahead of things, it’d be much better to create this .metadata_never_index file before running npm install.

As nor npm install (issue) nor yarn install (issue) have the creation of said file integrated, I use a preinstall script that does the job for me.

To enable it, add the line(s) below to your package.json:

"scripts": {
  "preinstall": "mkdir -p ./node_modules && touch ./node_modules/.metadata_never_index"
}

The preinstall script will be run right before npm install does its thing, ensuring the presence of the .metadata_never_index file inside ./node_modules 🙂

Did this help you out? Like what you see?
Thank me with a coffee.

I don't do this for profit but a small one-time donation would surely put a smile on my face. Thanks!

☕️ Buy me a Coffee (€3)

To stay in the loop you can follow @bramus or follow @bramusblog on Twitter.

The new Mac Pro is a design remix

Arun Venkatesan takes a deep dive into the design and engineering behind the new Mac Pro:

Apple held its annual developer conference, WWDC, this week in San Jose. In the keynote, aside from a slew of developer-focused software announcements, one new hardware announcement has attracted the most attention, the 2019 Mac Pro and Pro Display XDR.

Amazing device. Expensive too, but still amazing.

The new Mac Pro is a design remix →

SF Symbols

In addition to SwiftUI Apple also introduced SF Symbols at WWDC. Think of it as the Glyphicons that ship with Bootstrap, but then for iOS/iPadOS/tvOS apps.

SF Symbols provides a set of over 1,500 consistent, highly configurable symbols you can use in your app. Apple designed SF Symbols to integrate seamlessly with the San Francisco system font, so the symbols automatically ensure optical vertical alignment with text for all weights and sizes.

This was long overdue.

Each icon comes in comes in nine weights (from ultralight to black) and three sizes (small, medium, and large), which make them usable in just about any context they appear in: regular text, buttons, menus, … it’s all covered.

As outlined in WWDC2019 Session 206 – featuring @inferis who worked on it – they’re very easy to use them. Creating your own also is a breeze. Nice work, Tom!

One lesser detail about these though, is that some icons are only allowed to be used for referring to one of Apple’s apps. This seems logical for stuff like Face ID (which has a very specific icon), but is very limiting for apps such as Mail that have a very generic icon (e.g. the enveloppe):

Introducing SF Symbols WWDC2019 Session 206 (video + slides) →
SF Symbols →