libimobiledevice / libimobiledevice

A cross-platform protocol library to communicate with iOS devices
https://libimobiledevice.org
GNU Lesser General Public License v2.1
6.58k stars 1.32k forks source link

ideviceinfo -q com.apple.disk_usage.factory is showing wrong output of Storage value for iOS 11 #564

Open AbMathur opened 7 years ago

AbMathur commented 7 years ago

I have fired ideviceinfo -q com.apple.disk_usage.factory command on iOS 11 device & it is showing me the wrong output of storage value as compared to what is shown in the device.

Like I have 6.1 GB available in my device but AmountDataAvailable shown after this command is 3.7 GB.

We are getting the correct output of storage value for below iOS 11, Can someone help me in letting me know what is the change is iOS 11, why we are getting wrong values.??

JeremyAgost commented 6 years ago

Your iOS settings info is likely informing you about how much free + "purgeable" space is available. That is, your storage quite literally has 3.7 GB free but if temporary and cache data was ignored there would be a total of 6.1 GB free. If you have various cloud features enabled (e.g. iTunes Cloud or iCloud Photos) then things like recently played music tracks and full resolution photos are stored on the device as long as additional storage space isn't needed for direct user actions. If at this point you tried to install a 5 GB app, the OS would delete as much cached/temp data as necessary to make sure there was space for the new data.

I don't know of a reliable way to ask the device to report how much free + purgeable space it thinks is available, other than looking at the Settings Usage page. FWIW, recent versions of macOS do something similar. Performing "Get Info" on your Macintosh HD will show a different free space value than you would get from diskutil list.