doronz88 / pymobiledevice3

Pure python3 implementation for working with iDevices (iPhone, etc...).
https://discord.gg/52mZGC3JXJ
GNU General Public License v3.0
1.48k stars 202 forks source link

Cannot afc shell rm lock file produced by realm databases #1195

Closed ViRb3 closed 1 month ago

ViRb3 commented 1 month ago

Test environment

Describe the bug I'm trying to remove a folder from an app's Documents folder using afc. It works for normal files, but for lock.fifo files created as part of realm databases, the deletion hangs forever and never succeeds. Example structure:

example.realm
example.realm.lock
example.realm.management
├── access_control.control.mx
├── access_control.new_commit.cv
├── access_control.pick_writer.cv
├── access_control.versions.mx
├── access_control.write.mx
└── lock.fifo
example.realm.note

To Reproduce

pymobiledevice3 apps afc com.example.app
cd Documents
rm example.realm.management/lock.fifo

Expected behavior Deletion succeeds

Logs N/A, it just hangs

Additional context N/A

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

ViRb3 commented 1 month ago

For what is worth, iMazing also errors on the same file, so this may be an issue with Apple's implementation, but I don't know enough to tell.

doronz88 commented 1 month ago

This does sounds like an internal device error. You could try to view the syslog for any relevant hints in debugging this:

pymobiledevice3 syslog live -mi lock.fifo
prosch88 commented 1 month ago

I have this errors too on realm.db related files. It's not really pmd3 related. You get the same errors with libimobiledevice. If you try to pull these you get "lock.fifo isn't a file". ... Which is quite correct, as fifo "files" don't have content on the filesystem.