Android system test: a shell command to get multiple system attributes

I. Introduction

In the process of Android system testing, I often encounter parameters that require or multiple system attributes. If they are obtained one by one, the efficiency of writing code is relatively low. Today, I did not intend to see this one command to get things done when I searched online. It is really efficient. Record it. .

2. Implementation

From the Linux terminal:

adb shell getprop | grep "model\|version.sdk\|manufacturer\|hardware\|platform\|revision\|serialno\|product.name\|brand" 

From Windows PowerShell:

adb shell 
getprop | grep -e 'model' -e 'version.sdk' -e 'manufacturer' -e 'hardware' -e 'platform' -e 'revision' -e 'serialno' -e 'product.name' -e 'brand' 

Take a Samsung mobile phone as an example, the output content is as follows:

[gsm.version.baseband]: [G900VVRU2BOE1] 
[gsm.version.ril-impl]: [Samsung RIL v3.0] 
[net.knoxscep.version]: [2.0.1] 
[net.knoxsso.version]: [2.1.1] 
[net.knoxvpn.version]: [2.2.0] 
[persist.service.bdroid.version]: [4.1] 
[ro.board.platform]: [msm8974] 
[ro.boot.hardware]: [qcom] 
[ro.boot.serialno]: [xxxxxx] 
[ro.build.version.all_codenames]: [REL] 
[ro.build.version.codename]: [REL] 
[ro.build.version.incremental]: [G900VVRU2BOE1] 
[ro.build.version.release]: [5.0] 
[ro.build.version.sdk]: [21] 
[ro.build.version.sdl]: [2101] 
[ro.com.google.gmsversion]: [5.0_r2] 
[ro.config.timaversion]: [3.0] 
[ro.hardware]: [qcom] 
[ro.opengles.version]: [196108] 
[ro.product.brand]: [Verizon] 
[ro.product.manufacturer]: [samsung] 
[ro.product.model]: [SM-G900V] 
[ro.product.name]: [kltevzw] 
[ro.revision]: [14] 
[ro.serialno]: [e5ce97c7] 

Reference document: http://cn.voidcc.com/question/p-ymsfever-bbt.html 

Guess you like

Origin blog.csdn.net/jinhoward/article/details/108284100