In the ecosystem Android file creation often occurs โ€œunder the hoodโ€ while applications are running, but sometimes the user requires manual intervention. The need to create an empty file may arise to back up settings, test access rights, or work with specific software. Unlike desktop operating systems, this task is not always obvious in the mobile environment due to file system limitations. Modern shells such as sandbox.

Modern shells such as One UI ot Samsung or MIUI ot Xiaomioffer built-in tools, but their functionality is often limited to viewing and movement. To fully work with the file structure, you will need additional utilities or knowledge of console commands. Below we will analyze in detail the methods available to both ordinary users and advanced enthusiasts.

The choice of a specific method depends on your purpose and availability ROOT-rights. We will consider options from the simplest, using a graphical interface, to professional methods through ADB, which allow you to bypass the system limitations of standard file managers.

Using advanced file managers

The most accessible way for most smartphone owners is to install a specialized application. Standard file managers often hide the ability to create new objects, focusing on organizing existing data. However, third-party solutions such as Total Commander or Solid Explorerprovide a complete set of tools.

The Total Commander process is intuitive. After launching the application, you need to go to the desired directory through the side menu. Next, click on the icon with a sheet of paper and a plus sign located on the bottom control panel. The system will prompt you to enter the name of the future file and its extension.

It is important to consider that in modern versions Android (starting from 11 and higher) access to the root folder /Android/data is limited by security policies Scoped Storage. Even a powerful file manager can request special permission through the system window to work in protected partitions.

โš ๏ธ Attention: When working in system partitions without root access, you can only create a file in the user storage. An attempt to write to /system will result in an access error, even if the interface allows you to enter a name.

An alternative option is to use text editors such as QuickEdit. You simply create a new document, donโ€™t write anything in it, and save it right away. This is a universal method that works on any device, including budget models from Realme or Infinix.

๐Ÿ’ก

If the file manager does not allow you to create a file in the desired folder, try saving it first to the "Downloads" folder and then moving it to the target directory.

Creating a file through the emulator terminal

For users familiar with the environment Linux, a smartphone based on Android is a pocket computer with a full-fledged shell. Installing the application Termux from the store Google Play or F-Droid gives access to powerful console utilities without the need to obtain superuser rights.

After installing and initially configuring the terminal, you will need to give the application permission to access the storage. This is done with the command termux-setup-storage, after which the system request window will appear. After confirming access, you will receive a link to the internal memory in the form of a symbolic link storage.

The main command for creating an empty file on Linux-like systems is touch. It updates the file's timestamps, and if the file does not exist, it creates it with zero bytes in size. The syntax is extremely simple and does not require complex parameters.

touch my_empty_file.txt

This method is especially useful for developers or those who set up a server environment on the phone. The command executes instantly and does not consume CPU resources, unlike graphical applications. You can create files in batches, listing their names separated by a space.

โ˜‘๏ธ Preparing Termux for work

Done: 0 / 4

It is worth noting that files created through the terminal in the application's home directory may not be visible in a regular file manager without enabling the display of hidden files or a special path. To work in shared memory, use the path cd ~/storage/shared before executing the command touch.

Remote control method via ADB

The most flexible method, which does not require installing unnecessary applications directly on the smartphone, is to use a debug bridge Android Debug Bridge from a computer. This method is indispensable if the phone interface is frozen or the screen is damaged, but the system continues to work.

First, you need to activate developer mode on the device. Go to Settings โ†’ About phone and quickly click on the build number seven times. After the corresponding notification appears, go to the menu System โ†’ For developers and turn on the toggle switch USB debugging.

Connect your smartphone to the PC cable and make sure that a window asking you to trust this computer appears on the device screen. Confirm the action. Next, on your computer, in the command line or PowerShell, enter the command to enter the device shell:

adb shell

While in the shell, you can use the same utility touchas in the terminal on the device. The advantage of this method is that you can script the creation of many files or work with paths that are difficult to reach with a finger on a touch screen.

ADB Command Description of action Requires ROOT
adb shell touch /sdcard/test.txt Creates a file in internal memory No
adb shell touch /data/local/tmp/log Creates a file in a temporary folder No
adb root Restarts the demo server with superuser rights Yes (on firmware)
adb shell touch /system/build_test Attempting to write to the system one section Yes
What to do if ADB does not see the device?

Make sure ADB drivers for your phone model are installed. Try replacing the USB cable as some cables only support charging and not data transfer. Also check if the antivirus on your PC is blocking the connection.

Working with the file system on devices with ROOT

Having superuser rights (ROOT) removes almost all restrictions on the file system Android. However, this opens access to critical sections, an error in which can lead to inoperability of the device (bootloop). To manage files in this mode, the best application is Root Explorer or Mixplorer with an installed addon.

When you launch such a manager, the application will ask for permission to use superuser rights. After confirmation, you will be able to mount partitions in read-write mode (R/W). By default, system partitions are mounted read-only (R/O), so an attempt to create a file there without changing the status will fail.

The process of creating a file is similar to working in user mode, but with the ability to select any directory, including /system/etc or /vendor. This is often required when installing modified firmware or patches to change the behavior of the system.

โš ๏ธ Attention: Never create files with random names in system folders. Unnecessary objects can violate the integrity of system signature checks (Verified Boot), which is why the phone will stop booting.

An alternative method for advanced users is to use a terminal with rights su. By entering the command su in the same Termux, you will get a root shell. Next, the command touch will work wherever the file system allows.

๐Ÿ’ก

root access give full control over files, but disable the operation of banking applications and Google Pay services due to a violation of the integrity of the security system.

Automation of file creation through Tasker

For scenarios where a file needs to be created automatically according to a schedule or when a certain event occurs (for example, connecting to Wi-Fi), an automation application is ideal Tasker. This allows you to implement โ€œif-thenโ€ logic without writing complex code.

In the interface Tasker a new profile is created, tied to a trigger (time, sensor state, application launch). As a task, select the action โ€œSystemโ€ โ†’ โ€œWrite Fileโ€. You can leave the content field empty, and specify the full name of the object being created in the path field.

This approach is often used to log device operation or create markers that check other applications. For example, a flag file can signal that the backup procedure has been successfully completed.

  • ๐Ÿ“ฑ Time trigger: Creating a report every day at 23:59.
  • ๐Ÿ“ Geolocation: Fixing arrival at a point by creating a file with coordinates.
  • ๐Ÿ”‹ Battery charge: Logging the moment charging starts with an empty tag file.

Without this, automation will only work in the application folder.

๐Ÿ“Š Which method of creating files do you do you think is the most convenient?
Built-in file manager
Applications like Total Commander
Commands via Termux
Via computer (ADB)
Automation (Tasker)

Frequent problems and limitations of modern versions of Android

Starting with Android 11 and increasing in Android 13/14, Google has implemented strict restrictions on access to the file system. The mechanism Scoped Storage isolates applications from each other, prohibiting them from seeing neighbors' files without the user's explicit permission.

This means that even if you created a file through the terminal, it may not be visible in the gallery or standard Explorer if it is located in the folder Android/obb or Android/data specific application. The system considers these directories to be the private property of the app.

In addition, on devices from some manufacturers (for example, Xiaomi with a shell HyperOS or Huawei) there may be additional restrictions on the creation of files with certain extensions in the root of the internal drive to combat viruses and garbage.

โš ๏ธ Attention: Settings interfaces and menu item names may differ depending on the firmware version and smartphone model. Always check the latest manufacturer documentation if you can't find the switch you need.

If you encounter a "No access" error when trying to create a file, try changing the target folder to a public folder, such as Documents or Download. This is the most compatible path for any file operations in the modern ecosystem.

FAQ: Frequently Asked Questions

Is it possible to create a file with a dot at the beginning of the name (hidden file)?

Yes, this is possible in any file managers and through the terminal. On Linux systems, which includes Android, a file whose name begins with a dot (for example, .config) is automatically considered hidden. To view it in the file manager, you need to enable the โ€œShow hidden filesโ€ option in the application settings.

Why do you need to create empty files?

Empty files are often used as โ€œflagsโ€ (markers) for scripts and applications, signaling that some action has been performed. They are also needed for backing up names, testing the write speed of a drive, or bypassing the limitations of some apps that require a specific file to run.

Is it safe to use touch commands on the system?

The command touch itself is safe, since it only creates a file or changes its metadata. The danger is not the command, but the place where you write the file. Creating unnecessary objects in system folders can disrupt the operation of the OS, so be careful with paths.

Why does the file manager not allow you to save a file without an extension?

Some graphical shells require specifying an extension for the correct association of the file with the app. However, in the terminal or advanced managers, you can create a file with no name at all (just a dot) or without an extension. The Android system allows this, but may not display such a file in standard lists.

Will the created file be deleted after the phone is rebooted?

No, files created in the internal storage (/sdcard) or on the memory card are saved after the reboot. The exception is files created in temporary directories like /cache or /data/local/tmp, which can be cleared by the system when restarting or updating applications.