Instruments Energy Diagnostics -> Battery as percentage - ios

I ran several long-term battery tests using Developer >> Logging for Energy Diagnostics. I've sent them all into instruments where I am able to determine the "Energy Usage Level". However, is it possible to also get the battery percentage at that moment instead of the "Energy Usage Level".
I was hoping to be able to graph the battery life percentage over time during the application running, along with determining when my application woke from sleep or turned on GPS.
The testing was done on an iPhone 4, iOS 5.0.1.

Powergremlin doesn't do exactly what you're looking for, but it is open source so might start you on the way to implementing it yourself.

Sadly, it is not possible. I ended up writing an application that would write to a database the percentage of the battery after a x time wait. It's a shame that apples own tool does not work that way :\

Related

Why does lag only stop after reboot?

When playing games on my phone for an hour the phone starts lagging quite a bit. Nothing I do takes away the lag except restarting the device. I have tried some memory cleaning apps on the playstore, I have tried cleaning all running apps, and I have tried apps that 'simulate' a reboot.
I also checked online and there are no adb commands that clear the RAM (I don't want to clear the game cache).
I am trying to find a way to stop my phone's lag the same way restarting it does, but there seems to be no info online at all. So what is happening when the phone is rebooting that cannot be done with software alone? If it is because the memory is being cleaned, why are there no apps that work?
This could be due to a lot of reasons, one of the main ones being thermal limits. Once you have been playing for a while, your phone might have to throttle it's performance to maintain a temperature safe for the SoC inside. I will say however, that cluttering your phone and background processes with a lot of these "memory cleaning" apps probably isn't helpful. If you are on android, there is a built in optimization widget (on new-ish devices) that you can free up ram and storage with.

Keep iOS App Awake To Monitor Movement

I'm having trouble getting the main feature of my iOS application to work. I'm trying to create an app that measures the amount of movement over a period of a few hours using CoreMotion. All works fine when the device is awake, however the issue is that the device auto locks after a while and enters the background state, thus my methods for monitoring movement pause.
I'm searching for a possible solution to recording the device's movement whilst it has been locked, which may be to keep the app awake for a few hours at a time. I've looked into a bunch of possible solutions that have been used for this in the past, yet found out that these ways of doing it can now cause the app to be rejected by Apple.
Any help would be much appreciated please.
For anyone who is interested or stuck on a similar problem I figured out the solution to my question. I needed to utilise the iPhone's motion coprocessor, which tracks movement overtime and stores this data on the device. This is part of the CoreMotion framework and can be queried regardless of whether the application was open or not at the time of use. It's also worth mentioning that only the iPhone 5s and later have this hardware, so older devices will no be able to take advantage of this.
I hope this helps anyone who needs it.

Check how much memory or CPU is being used per app, for all running apps

I'm trying to analyze how much memory, battery and cpu usage is taken by each app that is currently running on my iOS device. I don't mind if this can be done programmatically or otherwise. I have XCode up and running and I realize it can be used to check the CPU/memory of apps I install and run on my device.
Just to be clear, I do not want the total CPU/memory usage, but rather per app for all apps that are currently running.
Is this possible in iOS 8.1, in any way, without jailbreaking my device?
Edit: I just tried out Instruments in XCode and I realize to use it, you need to be testing an app. Is it possible to use Instruments to get this system info, without testing a new app? Can I get this info from the terminal for example? Thanks.

Collecting system data from iOS device during automated testing

We are trying to build a mobile automated testing lab that has 20 or 30 devices and want to capture the utilizations on each device during testing. I'm looking to start with iOS devices. The type of data in Xcode Debug Instruments would be ideal. However, I need to be able to capture and export this data automatically for many devices.
I'm thinking the best way to get that data from so many iOS devices would be to build an app. The app would capture the iOS device's CPU, memory, and battery life, disk usage and running processes (basically, the same statistics as are generated in the Debug Instruments in Xcode), and then send the data to a database.
What frameworks or tools would be helpful for this?
It sounds like you might be best off using a solution such as New Relic's mobile monitoring system. They allow you to monitor performance across devices, memory usage and time profiling and HTTP requests remotely just by dropping their SDK into your apps.

Best way to benchmark iPhone app's battery usage?

What's the best way to benchmark an iPhone app's battery usage?
I'm working on an iPhone app that uses location services and runs in the background. It seems like the battery drains significantly faster with it running, but when I try to do some structured tests, the results are inconclusive.
The steps I'm taking are:
charge the battery to 100%
remove the SIM (I need it for my other phone)
turn off push for mail/calendar/contacts
reinstall the app
restart the phone
start the app
return to SpringBoard (the app selection screen)
I then wait for about 15 hours and see what the battery is at. The results so far are:
App not running - 69% left
App running - 65% left
App running - 83% left
Turns out the answer is to use Apple's Measure Energy Impact in Xcode.
The info it provides really helped track down what was causing our battery draining issue.
In retrospect, I should have said that I was completely new to iOS, and was not a developer (working on the app as QA).
Doesn't that just tell you that there's not a high correlation between battery usage and your app running? It looks like there's something else that's causing battery drain?
(Watch out though, that something else might be the number of gps satellites passing at the time - the faster it gets GPS, the less battery usage your app will consume - you might have to take a look at how much time your app actually spends running vs sleeping for each test)

Resources