Getting Cpu & Memory Usage Through the Tests

I’m running appium in my application’s tests. However I’m looking for a way to get cpu , memory and network info while I’m running tests.
I checked appium documents and couldnt find any info about that, should I have to use a 3rd party application for that? If thats so how can I do that?


1 Like

first you should mention where you want to get this data from:
device where tests are running (is it iOS or Android or ?) or PC where tests are running?

Sorry I forgot to mention that
I’m looking for the resource usage(Cpu,memory etc…) information from real IOS devices

with real iOS device there are 2 ways:

  • execute tests while enable memory usage with xCode profiler
  • programmatically in client log memory usage and read iOS sim logs with Appium

How can I do that?
Can you show me an example?

“programmatically in client log memory usage” - ask iOS dev.
“read iOS sim logs with Appium” - enable driver capability ‘showIOSLog’ = true.

I do not know but, how can you measure CPU and memory where your appium backend instruments is constantly keep running during automation. In such case, the numbers are not accurate, and specially in IOS, automation run on debug app, which it is different from its release counterpart.
And most important, you can baseline your app in certain conditions but this is manual activity and should not be mixed up with automation. I would not say this as performance testing at all.

Can you please discuss for Android?

with Android we did it using phones connected to same machine where tests are running.

in test code we just execute:

adb shell dumpsys cpuinfo
adb shell dumpsys meminfo 'your apps package name'

and in code just parse values needed. then we just printed them in test logs and just manually looked through them.

test itself was kind of walking among many screens and good long swipe with large lists.

1 Like

Thanks for your response
Isn’t there any way we can use appium so that it can be cross-compile? I am trying to avoid ADB commands

@Aleksei:The iOS Log does not provide useful w.r.t memory and CPU and memory usage . Does any one else have solution?

@Tolga_Tanriverdi Did you find any solution ?!

I’m still not found a solution for that.
We’ve found a solution for android already through using adb but we couldnt find a solution for IOS yet

Recall this discussion, I have same issue with @Tolga_Tanriverdi that I want to monitor CPU and Memory Usage through the tests. Can we using Xcode Instruments for this case? @Tolga_Tanriverdi have you found any solution?

Thank you Aleksei, you are so ‘‘helpful’’