In addition to this answer you can use the following solution which is taken from rohitverma's answer here and noticed in Lucky's comment.
I use QuickEdit Text Editor as default text editor and the relevant query looked like: am start -n /.activity.MainActivity -d file:///sdcard/airdroid/nmon.txt -activity-clear-task In my case, the final query for file aero.txt under /sdcard/airdroid/ looked like: am start -n /. -d file:///sdcard/airdroid/aero.txt -activity-clear-task (Enter am start to dive deeper into interesting stuff.)
#Open and edit text file in terminal android#
Open your favorite terminal app in Android and enter: su Keep the whole string ( /.) ready to be used. You may use the command dumpsys activity to see some more useful stuff. The output may look like: mFocusedActivity: ActivityRecord