4

How to retrieve SoC model name of an android device? E.g. Qualcomm MSM 8974 HAMMERHEAD (Flattened Device Tree) for Nexus 5. (E.g. CPU-Z app shows this info.)

artless noise
  • 21,212
  • 6
  • 68
  • 105
Tamas
  • 3,254
  • 4
  • 29
  • 51

3 Answers3

3

There is no Android specific API that provides this info. The android CPU-Z app includes a piece of native code that finds this information.

If you want to do the same, you will need to provide your own such native code routine, though I suspect that you can probably find a routine to port in a number of open source repositories.

zmarties
  • 4,809
  • 22
  • 39
2

The file /proc/cpuinfo contains exactly this info.

Tamas
  • 3,254
  • 4
  • 29
  • 51
  • 3
    cpuinfo does not include cpu manufacturer (eg: Qualcomm, Samsung, etc.) –  Apr 15 '16 at 22:59
  • 1
    @CodigosTutoriales There is a parameter in that file called `Hardware` which indirectly gives you that information. For example, on my old Karbonn A35 phone, this value was `MT6572` and on another Karbonn A30 phone, it was `MT6577` indicating that these are MediaTek SoC. – Prahlad Yeri Jul 04 '16 at 12:53
  • @PrahladYeri Thanks, however, it does not include model like Snapdragon , I want to do the same that CPU-Z does to get that info. –  Jul 04 '16 at 23:24
  • @user5395084 did you find out? – bj4947 Mar 20 '18 at 22:45
  • 1
    Some devices have nothing useful here :( – andreymal Nov 09 '19 at 17:59
  • On my end I only get `Qualcomm Technologies, Inc KONA`, which for me is not useful at all. I was hoping to get a 3 decimal ID number. After more Googling, still no answer on this :( – Raphael Setin Mar 10 '22 at 18:52
  • Hello from 2022 :) Do you find answer on this question? – Art Jun 28 '22 at 18:28
1

Try getprop ro.board.platform or cat /sys/firmware/devicetree/base/compatible.

Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124
5p0ng3b0b
  • 511
  • 4
  • 10
  • I got permission denied. How can I get the permission? – TIANLUN ZHU Dec 16 '20 at 08:07
  • @TIANLUNZHU if your device is rooted with Magisk, try to do `su` to get super user permissions. Btw, if your shell has a `#` instead of `$`, then it means you already have super user permissions. – Raphael Setin Mar 10 '22 at 18:54