Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I get android filesystem size in bytes from adb shell?

Tags:

android

shell

If I run from android shell the df command I get the sizes of all filesystems in human readable numbers. It seems that the command doesn't take any options (e.g. -something).

I want to get the exact size of the filesystem (in bytes).

I know I can get the sizes by creating an app which uses statfs. Is there any OTHER WAY to do it (via command)?

like image 308
chef Avatar asked Oct 20 '22 21:10

chef


1 Answers

Yes, as long as busybox is installed. (And if not, you could prompt the user to install it.)

You can use

busybox df -B 1

to get a report in bytes.

like image 191
chiastic-security Avatar answered Oct 22 '22 12:10

chiastic-security