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.)
Asked
Active
Viewed 4,791 times
4

artless noise
- 21,212
- 6
- 68
- 105

Tamas
- 3,254
- 4
- 29
- 51
3 Answers
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
-
@zmarties I was unable to find any such repo that supports ARM. – Binoy Babu Jun 25 '15 at 17:01
2
The file /proc/cpuinfo
contains exactly this info.

Tamas
- 3,254
- 4
- 29
- 51
-
3
-
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 -
-
1
-
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
-
1
Try
getprop ro.board.platform
or
cat /sys/firmware/devicetree/base/compatible
.

Eugen Pechanec
- 37,669
- 7
- 103
- 124

5p0ng3b0b
- 511
- 4
- 10
-
-
@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