Search code examples
androidadb

How to open a local file with Chrome using adb shell?


I want to open a local file with Chrome from the adb shell. Something like

adb shell 'echo This is a test input file > input.txt'
adb shell am start -a android.intent.action.VIEW -d input.txt

But it opens Chrome with the file name in the url but with an error message that the page cannot be opened. How can I do it?


Solution

  • Able to open a file from /storage/emulated/0/Android/data/com.android.chrome/files/Download/ via chrome.