find a pattern from grep in bash for computing average memory usage of android app

前端 未结 1 544
礼貌的吻别
礼貌的吻别 2021-01-27 06:40

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 <

相关标签:
1条回答
  • 2021-01-27 07:28

    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 }'
    
    0 讨论(0)
提交回复
热议问题