Android ADB commands to get the device properties

后端 未结 4 1662
独厮守ぢ
独厮守ぢ 2020-12-02 04:53

I am trying to get the device properties from ADB commands. I can how ever get those values by running sample android application. How ever I wish to get using adb shell com

相关标签:
4条回答
  • 2020-12-02 05:28
    adb shell getprop ro.build.version.sdk
    

    If you want to see the whole list of parameters just type:

    adb shell getprop
    
    0 讨论(0)
  • 2020-12-02 05:30

    From 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'
    

    Sample output for Samsung:

    [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]
    
    0 讨论(0)
  • 2020-12-02 05:40

    You should use adb shell getprop command and grep specific info about your current device, For additional information you can read documentation: Android Debug Bridge documentation

    I added some examples below:

    1. language - adb shell getprop | grep language

    [persist.sys.language]: [en]

    [ro.product.locale.language]: [en]

    1. boot complete ( device ready after reset) - adb shell getprop | grep boot_completed

    [sys.boot_completed]: 1

    1. device model - adb shell getprop | grep model

    [ro.product.model]: [Nexus 4]

    1. sdk version - adb shell getprop | grep sdk

    [ro.build.version.sdk]: [22]

    1. time zone - adb shell getprop | grep timezone

    [persist.sys.timezone]: [Asia/China]

    1. serial number - adb shell getprop | grep serialno

    [ro.boot.serialno]: [1234567]

    0 讨论(0)
  • 2020-12-02 05:46

    For Power-Shell

    ./adb shell getprop | Select-String -Pattern '(model)|(version.sdk)|(manufacturer)|(platform)|(serialno)|(product.name)|(brand)'
    

    For linux(burrowing asnwer from @0x8BADF00D)

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

    For single string find in power shell

    ./adb shell getprop | Select-String -Pattern 'model'
    

    or

    ./adb shell getprop | Select-String -Pattern '(model)'
    

    For multiple

    ./adb shell getprop | Select-String -Pattern '(a|b|c|d)'
    
    0 讨论(0)
提交回复
热议问题