How File Ownership Affects the iOS User Interface
Understanding the impact of the user and group associated with a file is a fundamental practice when interacting with various file systems. This document will show how to make files visible in the Files app by modifying what user owns a file. A common scenario where this applies is to test how different forms of multimedia display on iOS devices in order to capture and debug any issues that may arise.
Create a directory in the iOS Files app.
Find that directory in the file system and upload your multimedia files to said directory. To easily find the file path of a directory, review our FAQ article.
Once you have your various multimedia files on the device in the desired directory, you will notice that these files are not visible in the iOS user interface.
- To make this file visible in the iOS user interface, we need to change the user ownership of the file. Since iOS is based on a Unix-like architecture called Darwin, we can can use the
chown
command to accomplish this.
Example of the default file permissions:
good-kepler:/private/var/mobile/Containers/Shared/AppGroup/212AD6F7-2EC2-4C9D-B535-B0F48C1C834E/File Provider Storage/Videos root# ls -l
total 0
-rw-r--r-- 1 root mobile 0 Dec 15 10:23 text.txt
In the example above, we created the file as the root user, so the file ownership reflects this. The position of the word mobile represents the group associated with the file.
We need to change the user ownership to the mobile user:
chown mobile text.txt
The file permissions should now show that it belongs to the mobile user:
good-kepler:/private/var/mobile/Containers/Shared/AppGroup/212AD6F7-2EC2-4C9D-B535-B0F48C1C834E/File Provider Storage/Videos root# ls -la
total 0
drwxr-xr-x 2 mobile mobile 96 Dec 15 10:23 ./
drwxr-xr-x 3 mobile mobile 96 Dec 15 10:00 ../
-rw-r--r-- 1 mobile mobile 0 Dec 15 10:23 text.txt
- The file should now be visible in the iOS user interface.