Skip to content Skip to sidebar Skip to footer

Find A Pattern From Grep In Bash For Computing Average Memory Usage Of Android App

I want to get the average memory usage of some android app. All I want to do is to fetch only the memory usage. For example, below script provide instantaneous memory usage of mobi

Solution 1:

Piping to sed:

adb shell dumpsys meminfo | grep mobile_cep | sed 's/:.*//'

It is also trivial with awk if you are able to execute an awk script you don't need grep either:

adb shell dumpsys meminfo | awk -F'[: ]''/mobile_cep/ { print $1 }'

Post a Comment for "Find A Pattern From Grep In Bash For Computing Average Memory Usage Of Android App"