High battery drain using Xcode 13

I have two Mac Book Pro 16'' 2019. On both I see a very high battery drain using Xcode 13 while using the simulator. Even when the app is not running only the simulator is launched in the background the MacBook gets very hot and the battery drains empty very fast. For the beta this was ok. But with the RC I expected that this was only a temporary problem. Does some else has this problem also?

  • I bought a Macbook Air m1 16gb two days back, and I'm seeing the same issue. I am a Flutter developer, and I mostly work on vscode and android emulator/iOS simulator and battery performance is fine as it should be. BUT whenever I go and open up xcode for editing some swift code, my battery drains like no tomorrow. I thought xcode would drain less battery than Android studio or those emulators, but NOPE, xcode drains the most battery. Dear apple, pls fix this ASAP. If I had known this I'd have bought the mac mini and be at peace with it. No wonder apple store has such low ratings for xcode.

Add a Comment

Replies

I have MacBook Air M1, as soon as Xcode update to 13 M1's battery is out of the window. 10% through 10 minutes, this is not a joke. PLEASE HELP !

  • Same! ☹️

  • Same here, and absolutely terrible heating issues too, in the most basic of apps

  • I actually faced with same problem , macbook air m1 drains battery within one day , but i think this is a reason of using Xcode

Same problem

The same problem occurred.

And I resolved this problem by using an 87W Apple battery charger instead of a 30W Apple battery charger.

I have also faced similar issue. Before updating xcode to 13, i was using 3-4 simulator at once in my Macbook Pro M1 16GB, but now opening single simulator heats up the machine and drop the battery in huge ratio.

  • Same problem - fast battery drain and heating up when using Xcode.

Add a Comment

Same problem with me. I am using XCode 13 on the M1 MacBook pro. Battery draining fast. This should not happen with apple hardware using apple software.

Same problem here. I'm also using Xcode 13 on the M1 MacBook Pro. I used to get almost 14 hours of battery, and now I'm lucky if I get 4. It's a dramatic performance degradation. I really hope Apple pushes a fix.

On my iMac when using Xcode 13. the issue seems to be linked to the simulator used by the SwiftUI preview canvas. When it first loads, it will peg the simulator at around 200% CPU usage and increase watt usage from around 60W to over 100W even after I pause and close the canvas. Only way to clear it seems to be either killing the simulator process or Xcode. If I just compile to a simulator device every time I want to check the UI changes without ever opening the canvas after Xcode starts, other than a short spike during compile, it will hover around 60W. a bit of a pain but a workaround while Apple sort out the issue.

  • Same problem on my MacBook Pro 16" 2019 using XCode 13.1. I have downloaded Xcode 12.5.1 as well to compare and it does not have battery drain issues.

  • Apple doesn't address this anywhere I believe, or have I missed something. Any update on your part, have you got around this issue ?

Add a Comment

I've noticed that even after quitting Xcode 13 and simulators, the battery drain is still there (M1 Max 2021). I'm not just closing windows - I'm quitting the applications completely.

It's most noticeable while my MacBook sleeps: the battery consistently loses 2% or so per hour. Not a big deal for a couple of hours, but if I leave my MacBook sleeping for 2 or 3 days, I come back to find the battery almost dead. This is very consistently reproducible. If I open Activity Monitor, the '12 hr battery drain' records show that Xcode was indeed the main culprit, despite the fact it was no longer running.

Also reproducible: if I cold start my MacBook, and don't open Xcode, sleeping will drain almost no battery, even over longer timespans. Although it might seem odd that the battery drain persists after quitting, it's pretty clearly Xcode that is at fault.

Same problem!

My new MacBook Pro drains over 50% at night because of this issue. It happens anytime flutter is running on the simulator. I've attached a battery screenshot to show how fast it drains even with the screen off. I don't know why the simulator doesn't pause when the laptop goes to sleep, but it definitely should.

Anyone sees any difference with Xcode 13.2 ?

  • I just updated 13.1 to 13.2 today. With Xcode running but no open project, in Activity Monitor I see Xcode using ~90% of CPU, 1.11GB memory, and Energy Impact is 88.6. If I open Pages, it barely even shows up in these metrics.

    I have not been on battery long enough to judge if it's better or worse with 13.2, but I am going to guess it is not better.

    Machine details: 2018 MacBook Pro 15"

    Model Name: MacBook Pro

      Model Identifier: MacBookPro15,1

      Processor Name: 6-Core Intel Core i7

      Processor Speed: 2.2 GHz

      Number of Processors: 1

      Total Number of Cores: 6

      L2 Cache (per Core): 256 KB

      L3 Cache: 9 MB

      Hyper-Threading Technology: Enabled

      Memory: 16 GB

  • Update: as others have noted the battery drain issue definitely occurs with Simulator usage. If I just have XCode open the battery is ok in 13.2.

Add a Comment

Facing the same issue with the M1 pro, battery drains faster when the simulator is opened and since the last update it's been losing more battery than before.

I bought a new Macbook Air 8GB RAM 512GB SSD, 2 months ago. The battery used to come for 16 hours. But since I started using XCode battery performance has become horrible. Please look into this and provide a solution asap. Thanks.

Fixed it by using a 91W charger. The 61W wouldn't work for me.

Same problem with 2019 MBP running Monterey and Xcode 13.2.2.

I have used Xcode for over 10 years, and I have never ever seen anything like this. My computer actually died while being plugged in because battery got drained and power cable was not feeding enough power?! ***?

Activity Monitors Battery Tab reports Xcodes service XCBBuildService being responsible for the majority of the drain.

I’m using Swift Composable Architecture (TCA) resulting in many many local SPM Packages.

This is the only change I’ve done recently, which went from everything OK (using Xcode without TCA code base) to battery draining in a matter or minutes it feels like.

It is not only that battery drains fast, it is also that computer is CRAZY slow. CPU usage for Xcode is 240% or something (whatever that means, how can it be larger than 100%?)z

I will try Xcode 13.3 beta and see if there are any improvements…

  • It looks like Xcode 13.3 RC is not draining as much. Will post a comment after some days of evaluation.

Add a Comment