What is a practical way to test an "out of disk space" condition using the iOS Simulator?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
Create a small disk image:
Mount it to the relevant directory in your simulator app, e.g.:
Run app and perform your tests. This can also be done while the app is running. In this case you probably don't want to mount it as
Caches
orDocuments
directory directly because this would hide current files in those folders. Mount to a sub-directory instead. If this is not easily possible without changing paths in your app, mount the image somewhere else and copy data over before mounting it on top of the nonempty directory.To unmount:
However, please note that the detach operation fails if the mount point is moved. This happens all the time because Apple renames simulator directories on iOS 8 every time an app is run. In this case use the
mount
command to find the device you have mounted, e.g./dev/disk3s1 /Users/.../Library/...
, then unmount the disk image using the device name instead of the mount point:This isn't practical on the simulator (you'd have to fill up your Mac's disk.) The best way to achieve this test case is to use an actual device and fill with Music via iTunes and test on device.