`xcrun simctl clean` does not throw an error or warn if it fails

Originator:mars.martian
Number:rdar://20815003 Date Originated:05-May-2015 09:38 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 6.3 (6D1002)
Classification:Serious Bug Reproducible:Always
 
Summary:
If a file exists which `xcrun simctl clean` does not have permission to delete, it will fail but not throw an error or different exit code.
Furthermore, it will stop deleting files at this point instead of attempting to delete other files.

We ran into this by creating a file which the user does not have permissions to delete. We did not intend to create the file but nonetheless found out about it by `xcrun simctl clean` not working.

Steps to Reproduce:
1. From an iOS app run:
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"test"];
mkdir([path cStringUsingEncoding:NSUTF8StringEncoding], 744);

Then run this app under a simulator, and run `xcrun simctl clean` on that device.

Expected Results:
The file should be deleted from the simulator (since SpringBoard is actually able to delete that file) or at least an error should have been outputted by `xcrun simctl clean`.

Actual Results:
The file is not removed.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!