Battery Level From Terminal











up vote
2
down vote

favorite












Is there a way to get an iOS device battery level from terminal when it's plugged into the computer? I've looked into ioreg and that only displays my macbook's battery.










share|improve this question


























    up vote
    2
    down vote

    favorite












    Is there a way to get an iOS device battery level from terminal when it's plugged into the computer? I've looked into ioreg and that only displays my macbook's battery.










    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Is there a way to get an iOS device battery level from terminal when it's plugged into the computer? I've looked into ioreg and that only displays my macbook's battery.










      share|improve this question













      Is there a way to get an iOS device battery level from terminal when it's plugged into the computer? I've looked into ioreg and that only displays my macbook's battery.







      ios






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 9 '16 at 16:39









      GregWringle

      110312




      110312
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          I was able to get this information as recently as macOS 10.14.1 using the libimobiledevice formula from Homebrew. You need to use the most recent version of the library, hence the --HEAD appended to the install command:



          $ brew install --HEAD libimobiledevice


          After that, try these commands:



          $ idevice_id --list
          <UDID>

          $ ideviceinfo -u <UDID> --simple
          DeviceName: foo's phone
          HardwareModel: D22AP
          ProductName: iPhone OS
          ProductType: iPhone10,3
          ProductVersion: 12.0

          $ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
          BatteryCurrentCapacity: 43
          BatteryIsCharging: true
          ExternalChargeCapable: true
          ExternalConnected: true
          FullyCharged: false
          GasGaugeCapability: true
          HasBattery: true


          More information is available. Try ideviceinfo --help to list the additional domains you can query.






          share|improve this answer






























            up vote
            0
            down vote













            Seems like this might be doable via SSH



            http://iphonedevwiki.net/index.php/SSH_Over_USB



            Then with this command:



            https://github.com/magn2o/iOS-Battery-Status






            share|improve this answer





















            • Please post the commands in the answer so that if the links break, the answer stays.
              – Tah Tatsumoto
              Feb 9 '16 at 17:06


















            up vote
            0
            down vote













            You can use the command "cfgutil get batteryCurrentCapacity", you can get cfgutil by installing the command line tools for Apple Configurator.






            share|improve this answer





















            • This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
              – luckman212
              Sep 29 at 17:32











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35297388%2fbattery-level-from-terminal%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            I was able to get this information as recently as macOS 10.14.1 using the libimobiledevice formula from Homebrew. You need to use the most recent version of the library, hence the --HEAD appended to the install command:



            $ brew install --HEAD libimobiledevice


            After that, try these commands:



            $ idevice_id --list
            <UDID>

            $ ideviceinfo -u <UDID> --simple
            DeviceName: foo's phone
            HardwareModel: D22AP
            ProductName: iPhone OS
            ProductType: iPhone10,3
            ProductVersion: 12.0

            $ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
            BatteryCurrentCapacity: 43
            BatteryIsCharging: true
            ExternalChargeCapable: true
            ExternalConnected: true
            FullyCharged: false
            GasGaugeCapability: true
            HasBattery: true


            More information is available. Try ideviceinfo --help to list the additional domains you can query.






            share|improve this answer



























              up vote
              2
              down vote













              I was able to get this information as recently as macOS 10.14.1 using the libimobiledevice formula from Homebrew. You need to use the most recent version of the library, hence the --HEAD appended to the install command:



              $ brew install --HEAD libimobiledevice


              After that, try these commands:



              $ idevice_id --list
              <UDID>

              $ ideviceinfo -u <UDID> --simple
              DeviceName: foo's phone
              HardwareModel: D22AP
              ProductName: iPhone OS
              ProductType: iPhone10,3
              ProductVersion: 12.0

              $ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
              BatteryCurrentCapacity: 43
              BatteryIsCharging: true
              ExternalChargeCapable: true
              ExternalConnected: true
              FullyCharged: false
              GasGaugeCapability: true
              HasBattery: true


              More information is available. Try ideviceinfo --help to list the additional domains you can query.






              share|improve this answer

























                up vote
                2
                down vote










                up vote
                2
                down vote









                I was able to get this information as recently as macOS 10.14.1 using the libimobiledevice formula from Homebrew. You need to use the most recent version of the library, hence the --HEAD appended to the install command:



                $ brew install --HEAD libimobiledevice


                After that, try these commands:



                $ idevice_id --list
                <UDID>

                $ ideviceinfo -u <UDID> --simple
                DeviceName: foo's phone
                HardwareModel: D22AP
                ProductName: iPhone OS
                ProductType: iPhone10,3
                ProductVersion: 12.0

                $ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
                BatteryCurrentCapacity: 43
                BatteryIsCharging: true
                ExternalChargeCapable: true
                ExternalConnected: true
                FullyCharged: false
                GasGaugeCapability: true
                HasBattery: true


                More information is available. Try ideviceinfo --help to list the additional domains you can query.






                share|improve this answer














                I was able to get this information as recently as macOS 10.14.1 using the libimobiledevice formula from Homebrew. You need to use the most recent version of the library, hence the --HEAD appended to the install command:



                $ brew install --HEAD libimobiledevice


                After that, try these commands:



                $ idevice_id --list
                <UDID>

                $ ideviceinfo -u <UDID> --simple
                DeviceName: foo's phone
                HardwareModel: D22AP
                ProductName: iPhone OS
                ProductType: iPhone10,3
                ProductVersion: 12.0

                $ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
                BatteryCurrentCapacity: 43
                BatteryIsCharging: true
                ExternalChargeCapable: true
                ExternalConnected: true
                FullyCharged: false
                GasGaugeCapability: true
                HasBattery: true


                More information is available. Try ideviceinfo --help to list the additional domains you can query.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 10 at 13:53

























                answered Sep 29 at 18:15









                luckman212

                14118




                14118
























                    up vote
                    0
                    down vote













                    Seems like this might be doable via SSH



                    http://iphonedevwiki.net/index.php/SSH_Over_USB



                    Then with this command:



                    https://github.com/magn2o/iOS-Battery-Status






                    share|improve this answer





















                    • Please post the commands in the answer so that if the links break, the answer stays.
                      – Tah Tatsumoto
                      Feb 9 '16 at 17:06















                    up vote
                    0
                    down vote













                    Seems like this might be doable via SSH



                    http://iphonedevwiki.net/index.php/SSH_Over_USB



                    Then with this command:



                    https://github.com/magn2o/iOS-Battery-Status






                    share|improve this answer





















                    • Please post the commands in the answer so that if the links break, the answer stays.
                      – Tah Tatsumoto
                      Feb 9 '16 at 17:06













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Seems like this might be doable via SSH



                    http://iphonedevwiki.net/index.php/SSH_Over_USB



                    Then with this command:



                    https://github.com/magn2o/iOS-Battery-Status






                    share|improve this answer












                    Seems like this might be doable via SSH



                    http://iphonedevwiki.net/index.php/SSH_Over_USB



                    Then with this command:



                    https://github.com/magn2o/iOS-Battery-Status







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 9 '16 at 16:51









                    jackt

                    1




                    1












                    • Please post the commands in the answer so that if the links break, the answer stays.
                      – Tah Tatsumoto
                      Feb 9 '16 at 17:06


















                    • Please post the commands in the answer so that if the links break, the answer stays.
                      – Tah Tatsumoto
                      Feb 9 '16 at 17:06
















                    Please post the commands in the answer so that if the links break, the answer stays.
                    – Tah Tatsumoto
                    Feb 9 '16 at 17:06




                    Please post the commands in the answer so that if the links break, the answer stays.
                    – Tah Tatsumoto
                    Feb 9 '16 at 17:06










                    up vote
                    0
                    down vote













                    You can use the command "cfgutil get batteryCurrentCapacity", you can get cfgutil by installing the command line tools for Apple Configurator.






                    share|improve this answer





















                    • This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                      – luckman212
                      Sep 29 at 17:32















                    up vote
                    0
                    down vote













                    You can use the command "cfgutil get batteryCurrentCapacity", you can get cfgutil by installing the command line tools for Apple Configurator.






                    share|improve this answer





















                    • This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                      – luckman212
                      Sep 29 at 17:32













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    You can use the command "cfgutil get batteryCurrentCapacity", you can get cfgutil by installing the command line tools for Apple Configurator.






                    share|improve this answer












                    You can use the command "cfgutil get batteryCurrentCapacity", you can get cfgutil by installing the command line tools for Apple Configurator.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Apr 20 at 19:35









                    Marc St Onge

                    211




                    211












                    • This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                      – luckman212
                      Sep 29 at 17:32


















                    • This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                      – luckman212
                      Sep 29 at 17:32
















                    This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                    – luckman212
                    Sep 29 at 17:32




                    This doesn't work unless the phone is physically connected via USB unfortunately. Also, the command takes a long time to complete (about 6 seconds on my system). I know this information is exposed somehow via WiFi (iTunes Sync protocol) because it shows up in coconutBattery. Anyone know how this is done?
                    – luckman212
                    Sep 29 at 17:32


















                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f35297388%2fbattery-level-from-terminal%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Error while running script in elastic search , gateway timeout

                    Adding quotations to stringified JSON object values