# In advance, tabs.json have to be extracted via ADB by following way. (See https://android.stackexchange.com/a/199496/340082 for detail.) # adb forward tcp:9222 localabstract:chrome_devtools_remote # wget -O tabs.json http://localhost:9222/json/list import json with open('tabs.json') as f: tabs = json.load(f) with open('tabs.md', 'w') as f: f.write(f"# {len(tabs)} tabs in your Android Chrome\n\n") for tab in tabs: title = tab['title'] url = tab['url'] if len(title) > 0: f.write(f"- [{title}]({url})\n") else: f.write(f"- <{url}>\n") with open('tabs_onetab.txt', 'w') as f: for tab in tabs: title = tab['title'] url = tab['url'] f.write(f"{url} | {title}\n")