如何获取给定 Android 智能手机的板名

How to obtain the board name of a given Android Smartphone

我正在从源代码构建 LineageOS,想找出这个简单的东西。根据 AOSP documentation:

The device/board layer represents the physical layer of plastic on the device (i.e. the industrial design of the device). For example, North American devices probably include QWERTY keyboards whereas devices sold in France probably include AZERTY keyboards. This layer also represents the bare schematics of a product. These include the peripherals on the board and their configuration. The names used are merely codes for different board/device configurations.

它还引用了一些板名作为示例:

sardine, trout, goldfish

那么,给定零售智能phone,例如 Moto G5 或 Galaxy S8...如何获取它的主板名称?此外,我尝试了一些 google 搜索,例如“smartphone name + 版块名称”,但由于 "board" 这个词过于宽泛,我最终得到了大量不相关的结果。我还搜索了 Android -> 设置 -> 关于 phone 并找到了内核版本、内部版本号等信息,但不是我要找的信息。

查看 Build.BOARD。文档:https://developer.android.com/reference/android/os/Build.html#BOARD