iPhone - Storage variant discussion #18
Replies: 3 comments 1 reply
-
Neither answer I think is particularly simple. To answer your first question I'd imagine the reason why it's reporting it as a factor of 1000 is because the strict definition of GB is 1000 MB which is a 1000 KB etc etc, 1024 bytes would actually be 1 KiB which is a kibibyte. So when the iPhone is advertised as 128GB I imagine it is actually that and not 128GiB here's a link which should explain it a bit better: https://massive.io/file-transfer/gb-vs-gib-whats-the-difference/. That was my first thought as to what is happening there, although it is possible I'm wrong. Then for your second question, as part of the backup process the iPhone asks how much storage is available and decides for you if there is enough space available (but there is a way to ignore this). However I don't think there is a specific way to tell how much space will be used by the backup, the way I think you could do it is work out how much space is currently used by the device and that is going to be the most that the backup would use up, although should always be a decent amount less as things like applications aren't backed up. |
Beta Was this translation helpful? Give feedback.
-
@artehe , Thanks for the clarification regarding the iPhone storage process. For the second question, if the user is having 128Gb variant and tries to use this package to take the backup of the iPhone, we need to know if the client has enough storage space in his system. If it is not present, we can throw an alert message so that the user can know. Do we have any other work around process to achieve the above one? Let me know your thoughts on it. |
Beta Was this translation helpful? Give feedback.
-
The closest way I can think of at the moment would be to make a call using the LockdownClient in the "com.apple.disk_usage" to get the current disk capacity and the current disk available and then work out how much space of that is used. So if you did: Then using result get the keys "TotalDataCapacity" and "TotalDataAvailable", use those values to work out the current usage. While that won't be a 100% accurate size for the backup I can't imagine that the backup will be any bigger than that. |
Beta Was this translation helpful? Give feedback.
-
Hi @artehe ,
I have added the new function to get the storage details from the connected iPhone. The function name is GetStorageDetails in Diagnostic services. Here, I'm able to get the below items from the given services.
From the above list, I can use only the TotalDiskCapacity (6th one) as it mentions the total storage value of the connected iPhone device in bytes. I have used the below function to get the byte values in GB.
When I use the above function, we are not able to get the exact value of the connected iPhone. Because, I use 128GB variant and its byte values are 128000000000 bytes. Below are the list of questions that needs clarification.
Beta Was this translation helpful? Give feedback.
All reactions