Search code examples
androidshelladb

adb find phone partitions


I need the command to find the partition of all Android devices.

For example, on some Samsung phones, you can use the following command to list the device partitions:

adb shell
ls -al /dev/block/platform/msm_sdcc.1/by-name

It turns out that on all Android devices, finding the partition's address is in /dev/block/platform/xxxx/by-name.

How to find the xxxx folder?


Solution

  • You can use toybox find:

    toybox find /dev/block/platform -type d -name by-name
    

    Toybox is included with Android 6.0 (Marshmallow) and all later Android versions.