So what can you do if you find a root-owned file that is preventing your app from running? Here are the steps I followed to remove the offending files:
Next steps:
• In Xcode connected to Vision Pro, download the app's container to preserve app data for reloading later
• On Vision Pro, delete the app thereby destroying the app’s container which should delete any root owned directories and files as well as all data
• Download the app from the App Store
• Test that code encountering the issues [in this case entity.write(to:)] is working and that the result is as expected [in this case check that .reality file automatically opens QuickLook as expected].
• If successful resume app development on visionOS
• Build and run the development version of the app on the Vision Pro device
• Test that code [in this case entity.write(to:)] is still working
Optional steps to restore the app's data:
[Note these optional steps may not work if the development version container data store needs migration]
• After a successful test, download the app container to the Mac
• Copy the previous container’s Application Support folder into the newly downloaded container
• Replace the app container on Vision Pro with the modified container
• Build and run the development app version on the Vision Pro device
• Test that the code [e.g. write(to:)] is still working
Following the steps above solved the root corruption for me and allowed continued app development.
However, the fix does not solve the fundamental issue of how some app with root permission on visionOS left files in my app's sandbox which prevented my app from executing a key capability.
Topic:
Spatial Computing
SubTopic:
General
Tags: