{"id":18592682,"url":"https://github.com/linuxndroid/adb-cheat-sheet","last_synced_at":"2025-05-16T10:10:29.733Z","repository":{"id":198818607,"uuid":"701613283","full_name":"Linuxndroid/ADB-Cheat-Sheet","owner":"Linuxndroid","description":"A Complete ADB Commad Cheat Sheet 2023. Your Journey to Mastering adb shell Begins Here","archived":false,"fork":false,"pushed_at":"2023-10-07T04:14:32.000Z","size":111,"stargazers_count":48,"open_issues_count":0,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T21:43:23.179Z","etag":null,"topics":["adb","android","android-adb"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Linuxndroid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-07T04:05:56.000Z","updated_at":"2025-02-06T15:48:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"371c97d0-7645-48a8-8bbd-57b9f1f48992","html_url":"https://github.com/Linuxndroid/ADB-Cheat-Sheet","commit_stats":null,"previous_names":["linuxndroid/adb-cheat-sheet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linuxndroid%2FADB-Cheat-Sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linuxndroid%2FADB-Cheat-Sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linuxndroid%2FADB-Cheat-Sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linuxndroid%2FADB-Cheat-Sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Linuxndroid","download_url":"https://codeload.github.com/Linuxndroid/ADB-Cheat-Sheet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509473,"owners_count":22082892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","android","android-adb"],"created_at":"2024-11-07T01:09:34.646Z","updated_at":"2025-05-16T10:10:29.725Z","avatar_url":"https://github.com/Linuxndroid.png","language":null,"readme":"\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eAndroid™ Debug Bridge (adb)\u003c/h1\u003e\n  \u003ch2\u003eThe Swiss Army Knife for Android\u003c/h2\u003e\n  \u003ch3\u003eYour Journey to Mastering \u003ci\u003eadb shell\u003c/i\u003e Begins Here\u003c/h3\u003e\n\n\u003c/div\u003e\n\n\u003chr\u003e\n\n\n\nI have created customized scripts specifically for activities, and I am confident that you will find them useful. Here is an example script that specifically targets activities.\n\nTo utilize the script, you can run it in any terminal with ADB installed, or directly on your device. Simply navigate through the graphical user interface (GUI) on \nyour phone and explore different options and GUIs. Whenever you perform an action that triggers an activity, the script will provide you with a complete ADB command. \n\n```bash\n#!/usr/bin/env bash\n# Author: wuseman\n\nadb logcat | awk '                                                                                    \n/act=android.intent.action.MAIN/ \u0026\u0026 /cmp=/ {\n    match($0, /act=[^ ]+/);\n    act=\"\\033[95m\" substr($0, RSTART+4, RLENGTH-4) \"\\033[0m\";\n    match($0, /cmp=[^ ]+/);\n    cmp=\"\\033[93m\" substr($0, RSTART+4, RLENGTH-4) \"\\033[0m\";\n    print \"adb shell am start -a '\\''\" act \"'\\'' -n '\\''\" cmp \"'\\''\"\n}'\n```\n\nHere is another one for swiping, this command retrieves touch event coordinates using getevent, and then uses awk to construct a touchscreen swipe command for input. Here's a description for it:\n\nThis command reads the output of adb shell getevent -l and searches for lines containing EV_ABS (absolute position event) and EV_SYN (event synchronization). It captures the X and Y coordinates of the touch event and constructs a touchscreen swipe command for input. The command then prints the generated touchscreen swipe command with the captured coordinates.\n\nThe `ABS_MT_POSITION_X` and `ABS_MT_POSITION_Y` values are stored in the event array. When a line with EV_ABS is encountered, the corresponding `X` and `Y` coordinates are captured. When a line with EV_SYN is encountered, it checks if both X and Y coordinates are available. If so, it constructs the touchscreen swipe command with the captured coordinates and a duration of 1000 milliseconds.\n\nThis command is useful for simulating touch events on an Android device using input commands:\n\n```bash\n#!/usr/bin/env bash\n# Author: wuseman\n\nadb shell getevent -l | awk '\n    /EV_ABS/ {\n        event[$3] = strtonum(\"0x\" $NF)\n    }\n    /EV_SYN/ {\n        if (event[\"ABS_MT_POSITION_X\"] \u0026\u0026 event[\"ABS_MT_POSITION_Y\"]) {\n            printf \"adb shell input touchscreen swipe %d %d %d %d 1000\\n\",\n                event[\"ABS_MT_POSITION_X\"], event[\"ABS_MT_POSITION_Y\"],\n                event[\"ABS_MT_POSITION_X\"], event[\"ABS_MT_POSITION_Y\"]\n        }\n    }\n'\n```\nThe final generated command will be in the format:\n\n```bash\nadb shell input touchscreen swipe \u003cstart_x\u003e \u003cstart_y\u003e \u003cend_x\u003e \u003cend_y\u003e 1000\n```\n\n### Highlight 'string' with Rainbow Colors\n    \n```bash\n#!/usr/bin/env bash\n# Author: wuseman\n\n adb logcat | awk '{\n    gsub(\"string\", \"\\033[1;31m\\033[47mT\\033[32m\\033[33me\\033[34ml\\033[1;36mi\\033[1;35ma\\033[0m\")\n    print\n}'\n```\n\n    \n### Highlight Lines Containing 'Wifi' in Red color\"\n    \n```bash\n#!/usr/bin/env bash\n# Author: wuseman\n\n adb logcat | awk -v color=\"\\033[31m\" '{\n    gsub(/\\033\\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, \"\")\n     if (index($0, \"Wifi\") \u003e 0 || index($0, \"wifi\") \u003e 0) {\n        gsub(/(Wifi|wifi)/, color \"\u0026\" \"\\033[0m\")\n    }\n    print\n }'\n```\n\n### Mark Matching Lines with Red Background\n\n```bash\n#!/usr/bin/env bash\n# Author: wuseman\n\nadb logcat | awk '\n    {\n        line = tolower($0)\n        if (line ~ /\u003cchangemeToAStringToMatch\u003e/) {\n            printf \"\\033[41m%s\\033[0m\\n\", $0\n        } else {\n            print\n        }\n    }\n    `\n```\n\n### Colorize Words Individually\n\n\n\n```bash\nadb logcat | awk '{ for(i=1; i\u003c=NF; i++) printf \"\\033[38;5;%dm%s\\033[0m \", int(rand()*216)+16, $i; print \"\" }'\n```\n\n### Colorize Tags with Unique Colors\n\n```bash\nadb logcat | awk '{\n    if ($6 in colorMap) {\n        color = colorMap[$6]\n    } else {\n        color = colorCode\n        colorCode = (colorCode + 1) % 216 + 16\n        colorMap[$6] = color\n    }\n    gsub($6, \"\\033[38;5;\" color \"m\u0026\\033[0m\")\n} 1'\n```\n\n### Colorize Entire Lines with Unique Colors\n\n```bash\nadb logcat | awk 'BEGIN{\n    colorCode = 16\n} {\n    if ($6 in colorMap) {\n        color = colorMap[$6]\n    } else {\n        color = colorCode\n        colorCode = (colorCode + 1) % 216 + 16\n        colorMap[$6] = color\n    }\n    printf \"\\033[38;5;%dm%s\\033[0m\\n\", color, $0\n}'\n```\n\n\n### To dump all data from database files in the data folder using 8 parallel threads\n\n* Resulting in more than 100% faster performance compared to using a single core, you can use the following sentence:\n\n```bash\nfind /data/data -name '*db' -type f -print0 i|xargs -0 -n1 -P$(nproc) sh -c 'echo .dump | sqlite3 \"$0\"'\n```\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid™ Source Code\u003c/h2\u003e\u003c/summary\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"https://cs.android.com/android/platform/superproject/\"\u003eAndroid™ Source Code\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid™ Issue Tracker\u003c/h2\u003e\u003c/summary\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"https://code.google.com/p/android/issues/entry\"\u003eAndroid™ Issue Tracker\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid™ SDK Tools\u003c/h2\u003e\u003c/summary\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"https://dl.google.com/android/repository/platform-tools_r32.0.0-linux.zip\"\u003eDownload SDK Platform-Tools for Linux\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"https://dl.google.com/android/repository/platform-tools_r32.0.0-darwin.zip\"\u003eDownload SDK Platform-Tools for MacOSX\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"https://dl.google.com/android/repository/platform-tools-latest-windows.zip\"\u003eDownload SDK Platform-Tools for Windows\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid™ Tools\u003c/h2\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://github.com/androguard/androguard/\"\u003eAndroguard - Disassemble DEX/ODEX bytecodes\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://github.com/SlackingVeteran/frija/releases/download/v1.4.4/Frija-v1.4.4.zip\"\u003eFrija - Samsung firmware downloader\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Default Applications\u003c/h2\u003e\u003c/summary\u003e\n\n  \u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.modemui.activities.USB.settings/#Intent;scheme=android-app;end\"\u003eClick to Open - ADB Settings\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.popupcalculator/#Intent;scheme=android-app;end\"\u003eClick to Open - Calculator\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.launcher/#Intent;scheme=android-app;end\"\u003eClick to Open - Home Launcher\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.gms/#Intent;scheme=promote_smartlock_scheme;end\"\u003eClick to Open - Screen Smartlock\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.android.settings/#Intent;scheme=android-app;end\"\u003eClick to Open - Settings\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.servicemodeapp/#Intent;scheme=promote_USBSettings_scheme;end\"\u003eClick to Open - USB Settings\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Applications\u003c/h2\u003e\u003c/summary\u003e\n\n  \u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"https://galaxy.store/alliance\"\u003eClick to Open - Alliance Shield X (Galaxy Store)\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.rrivenllc.shieldx/#Intent;scheme=android-app;end\"\u003eClick to Open - Alliance Shield X (Application)\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Samsung Applications\u003c/h2\u003e\u003c/summary\u003e\n\u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.samsungapps/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Apps\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.android.settings/com.samsung.android.settings.biometrics.fingerprint.FingerprintEntry/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Biometrics Fingerprint ID\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.samsung.android.dialer/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Dialer Call\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.myfiles/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung My Files\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.samsung.knox.securefolder/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Knox Secure Folder\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.app.samsungapps/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Galaxy Store\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.samsung.knox.securefolder/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Secure Folder\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.sec.android.easyMover/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Smart Switch\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.samsung.knox.securefolder/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Smart Switch\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.android.settings/com.samsung.android.settings.biometrics.fingerprint.FingerprintEntry/#Intent;scheme=android-app;end\"\u003eClick to Open - Samsung Touch ID\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Google Applications\u003c/h2\u003e\u003c/summary\u003e\n\n\u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.apps.googleassistant/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Assistant\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.android.chrome/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Chrome Browser\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.gm/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Gmail\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.gsf.login.LoginActivity/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Login Account\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.apps.maps/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Maps\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.googlequicksearchbox/#Intent;scheme=android-app;end\"\u003eClick to Open - Google Quicksearchbox\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.google.android.youtube/#Intent;scheme=android-app;end\"\u003eClick to Open - YouTube\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Motorola Applications\u003c/h2\u003e\u003c/summary\u003e\n\n  \u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.motorola.launcher3/#Intent;scheme=android-app;end\"\u003eClick to Open - Motorola Default Launcher\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Xiaomi Applications\u003c/h2\u003e\u003c/summary\u003e\n\n  \u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"intent://com.mi.android.globalFileexplorer/#Intent;scheme=android-app;end\"\u003eClick to Open - Mi Manager\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eOpen Android™ Secret Codes\u003c/h2\u003e\u003c/summary\u003e\n  \u003cblockquote\u003e\n  \u003cp\u003e\u003cstrong\u003eNote:\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eIf they are not available from GitHub, please visit: \u003ca href=\"http://www.nr1.nu/android/applicationLauncher/\"\u003ehttp://www.nr1.nu/android/applicationLauncher/\u003c/a\u003e to get clickable URLs to launch the application.\u003c/p\u003e\n\u003c/blockquote\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"tel:%20*#06*\"\u003e# Click to Open USSD Code - Show IMEI - *#06*\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"tel:%20*#0*#\"\u003e# Click to Open USSD Code - Show Secret Diagnostic Mode - *#0#*\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSecret Codes™ (Unstructured Supplementary Service Data codes))\u003c/h2\u003e\u003c/summary\u003e\n  \n## Secret Codes™ \u003csmall\u003eSamsung Latest Models\u003c/small\u003e\n\n| Secret Code          | Description      | ADB Activity                                                                                               |\n|----------------------|----------------------------------|--------------------------------------------------------------------------------------------|\n| `*#0*#`              | Diagnostic Test Menu             | com.sec.android.app.hwmoduletest/com.sec.android.app.hwmoduletest.HwModuleTest\n| `*#06#`              | IMEI number                      | com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.ShowIMEI         |\n| `*#0228#`            | Battery status                   | com.sec.android.app.factorykeystring/com.sec.android.app.status.BatteryStatus              |\n| `*#0*#`              | HW Module Test                   | com.sec.android.app.hwmoduletest/com.sec.android.app.hwmoduletest.HwModuleTest             |\n| `*#1234`             | Firmware info                    | com.sec.android.app.factorykeystring/com.sec.android.app.version.SimpleVersion             |\n| `*#2222#`            | Service Mode                     | com.sec.android.RilServiceModeApp/com.sec.android.RilServiceModeApp.ServiceModeApp         |\n| `*#2222#`            | WiFi Info                        | com.sec.android.app.servicemodeapp/com.sec.android.app.servicemodeapp.WifiInfoActivity     |\n| `*#2663`             | Touch Firmware                   | com.sec.android.app.factorykeystring/com.sec.android.app.status.touch_firmware             |\n| `*#0808`             | Samsung USB Settings             | com.sec.usbsettings/com.sec.usbsettings.USBSettings                                        |\n| `*#2683662#`         | Access Samsung Service Mode      | com.sec.android.RilServiceModeApp/com.sec.android.RilServiceModeApp.ServiceModeApp         |\n| `*#9090`             | Check Diagnostic Configuration   | com.sec.android.RilServiceModeApp/com.sec.android.RilServiceModeApp.ServiceModeApp |\n| `*#9900`             | Access Samsung SysDump Mode      | com.sec.android.app.servicemodeapp/com.sec.android.app.servicemodeapp.SysDump\n| `*#12580*369#`       | Software and Hardware Information| com.sec.android.app.factorykeystring/com.sec.android.app.version.MainVersion\n| `*#0283*`            | Check the Audio Loopback Control | com.sec.android.app.factorykeystring/com.sec.android.app.status.LoopbackTestNew\n| `*#34971539#`        | Check Camera Status and Firmware | com.sec.factory.camera/com.sec.android.app.camera.firmware.CameraFirmwareActivity\n| `*#22558463#`        | Reset Total Call Time            | com.sec.android.app.servicemodeapp/com.sec.android.app.servicemodeapp.ResetTotalCallTime\n| `*#1111#`            | Check FTA Software Version       | com.sec.android.RilServiceModeApp/com.sec.android.RilServiceModeApp.ServiceModeApp\n| `**04*[old Pin]*[new Pin]*[new Pin]` |  Change SIM Card PIN | N/A |\n\n\n\n\n\n\n\n\n\n\n\n\n### Secret USSD short codes for \u003csmall\u003eAT\u0026T\u003c/small\u003e\n\n| Code                      | Description\n|---------------------------|----------------------------------------------------------------------------------------------------------------|\n| `*61`                     | Block individual unwanted inbound calls                                                                         |\n| `*80`                     | Turn off call blocking                                                                                          |\n| `*78#`                    | Do Not Disturb mode (blocks all incoming calls). Callers will hear a busy signal                                |\n| `*79#`                    | Turn off Do Not Disturb mode                                                                                    |\n| `*67+Phone number+#`      | Blocks outgoing Caller ID on a per-call basis. Information still visible to toll-free numbers and 911           |\n| `*370#`                   | Disable call waiting                                                                                            |\n| `*371#`                   | Reactivate call waiting                                                                                         |\n\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSecret USSD short codes for AT\u0026T\u003c/h2\u003e\u003c/summary\u003e\n  \n  | Code | Description |\n  |------|-------------|\n  | `*61` | Block individual unwanted inbound calls |\n  | `*80` | Turn off call blocking |\n  | `*78#` | Do Not Disturb mode (blocks all incoming calls). Callers will hear a busy signal |\n  | `*79#` | Turn off Do Not Disturb mode |\n  | `*67+Phone number+#` | Blocks outgoing Caller ID on a per-call basis. Information still visible to toll-free numbers and 911 |\n  | `*370#` | Disable call waiting |\n  | `\n\n*371#` | Reactivate call waiting |\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid™ Default paths\u003c/h2\u003e\u003c/summary\u003e\n  \n  | Paths | Description |\n  |-------|-------------|\n  | `/data/data/\u003cpackage\u003e/databases` | Default storage for `.db` files |\n  | `/data/data/\u003cpackage\u003e/shared_prefs/` | Default storage for `shared` preferences |\n  | `/data/app` | Default storage for `third-party` apps |\n  | `/system/app` | Default storage for `system` apks |\n  | `/mmt/asec` | Default storage for `encrypted` files |\n  | `/mmt/emmc` | Default storage for `internal` storage |\n  | `/mmt/sdcard` | Default storage for `external` mmc/sdcard |\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAndroid Versions\u003c/h2\u003e\u003c/summary\u003e\n  \n  | Version | API/SDK | Version Code | Codename | Release Year |\n  |---------|---------|--------------|----------|--------------|\n  | `Android 13` | Level 33 | TIRAMISU | Tiramisu 2 | 2022 |\n  | `Android 12` | Level 32 | S _V2 | Snow Cone 2 | 2022 |\n  | `Android 12` | Level 31 | S | Snow Cone | 2021 |\n  | `Android 11` | Level 30 | R | Red Velvet Cake | 2020 |\n  | `Android 10` | Level 29 | Q | Quince Tart | 2019 |\n  | `Android 9` | Level 28 | P | Pie | 2018 |\n  | `Android 8.1` | Level 27 | O_MR1 | Oreo | 2017 |\n  | `Android 8.0` | Level 26 | O | Oreo | 2017 |\n  | `Android 7.1` | Level 25 | N_MR1 | Nougat | 2016 |\n  | `Android 7.0` | Level 24 | N | Nougat | 2016 |\n  | `Android 6` | Level 23 | M | Marshmallow | 2015 |\n  | `Android 5.1` | Level 22 | LOLLIPOP_MR1 | LOLLIPOP | 2015 |\n  | `Android 5.0` | Level 21 | LOLLIPOP, L | LOLLIPOP | 2014 |\n  | `Android 4.4W` | Level 20 | KITKAT_WATCH | KitKat | 2014 |\n  | `Android 4.4` | Level 19 | KITKAT | KitKat | 2013 |\n  | `Android 4.3` | Level 18 | JELLY_BEAN_MR2 | Jelly Bean | 2012 |\n  | `Android 4.2` | Level 17 | JELLY_BEAN_MR1 | Jelly Bean | 2012 |\n  | `Android 4.1` | Level 16 | JELLY_BEAN | Jelly Bean | 2012 |\n  | `Android 4.0.3 –\u003e 4.0.4` | Level 15 | ICE_CREAM_SANDWICH_MR1 | Ice Cream Sandwich | 2011 |\n  | `Android 4.0.1 –\u003e 4.0.2` | Level 14 | ICE_CREAM_SANDWICH | Ice Cream Sandwich | 2011 |\n  | `Android 3.2` | Level 13 | HONEYCOMB_MR2 Honeycomb | Honeycomb | 2011 |\n  | `Android 3.1` | Level 12 | HONEYCOMB_MR1 | Honeycomb | 2011 |\n  | `Android 3.0` | Level 11 | HONEYCOMB | Honeycomb | 2011 |\n  | `Android 2.3.3 –\u003e 2.3.7` | Level 10 | GINGERBREAD_MR1 | Gingerbread | 2011 |\n  | `Android 2.3.0 –\u003e 2.3.2` | Level 9 | GINGERBREAD | Gingerbread | 2010 |\n  | `Android 2.2` | Level 8 | FROYO | Froyo | 2010 |\n  | `Android 2.1` | Level 7 | ECLAIR_MR1 | Eclair | 2010 |\n  | `Android 2.0.1` | Level 6 | ECLAIR_0_1 | Eclair | 2010 |\n  | `Android 2.0` | Level 5 | ECLAIR | Eclair | 2010 |\n  | `Android 1.6` | Level 4 | DONUT Donut | Donut | 2009 |\n  | `Android 1.5` | Level 3 | CUPCAKE Cupcake | Cupcake | 2009 |\n  | `Android 1.1` | Level 2 | BASE_1_1 | Petit Four | 2009 |\n  | `Android 1.0` | Level 1 | BASE | N/A | 2008 |\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eADB Shell / Fastboot install\u003c/h2\u003e\u003c/summary\u003e\n  \n  ### Arch Linux (pacman)\n  \n  ```bash\n  pacman -S android-tools\n  ```\n  \n  ### Debian Linux (apt)\n  \n  ```bash\n  apt install adb fastboot -y    \n  ```\n  \n  ### Gentoo Linux (portage)\n  ```bash\n  emerge --ask dev-util/android-sdk-update-manager dev-util/android-tools\n  ```\n  \n  ### Fedora Linux (dnf)\n  \n  ```bash\n  dnf install adb\n  ```\n  \n  ### GNU/Linux (source)\n  ```bash\n  1) Download the Android SDK Platform Tools ZIP file for Linux.\n  2) Extract the ZIP to an easily-accessible location (like the Desktop for example).\n  3) Open a Terminal window.\n  4) Enter the following command: cd /path/to/extracted/folder/\n  5) This will change the directory to where you extracted the ADB files.\n  6) So for example: cd /Users/Doug/Desktop/platform-tools/\n  7) Connect your device to your Linux machine with your USB cable. \n     Change the connection mode to “file transfer (MTP)” mode. \n     This is not always necessary for every device, but it’s recommended so you don’t run into any issues.\n  8) Once the Terminal is in the same folder your ADB tools are in, you can execute the following command to launch the ADB daemon: ./adb devices\n  9) Back on your smartphone or tablet device, you’ll see a prompt asking you to allow USB debugging. Go ahead and grant it.\n  ```\n  \n  ### Windows (source)\n  \n  ```bash\n  1) Download: https://dl.google.com/android/repository/platform-tools-latest-windows.zip\n  2) Extract the contents of this ZIP file into an\n\n easily accessible folder (such as C:\\platform-tools)\n  3) Open Windows explorer and browse to where you extracted the contents of this ZIP file\n  4) Then open up a Command Prompt from the same directory as this ADB binary. This can be done by holding \n       Shift and Right-clicking within the folder then click the “Open command window here” option. \n  5) Connect your smartphone or tablet to your computer with a USB cable. \n        Change the USB mode to “file transfer (MTP)” mode. Some OEMs may or may not require this, \n        but it’s best to just leave it in this mode for general compatibility.\n  6) In the Command Prompt window, enter the following command to launch the ADB daemon: adb devices\n  7) On your phone’s screen, you should see a prompt to allow or deny USB Debugging access. Naturally, \n        you will want to grant USB Debugging access when prompted (and tap the always allow check box if you never want to see that prompt again).\n  8) Finally, re-enter the command from step #6. If everything was successful,\n        you should now see your device’s serial number in the command prompt (or the PowerShell window).\n  ```\n  \n  \u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAwesome Aliases For ADB\u003c/h2\u003e\u003c/summary\u003e\n  \n  Copy and paste to add the below aliases in ~/.bashrc\n  \n  ```bash\n  cat \u003c\u003c! \u003e\u003e ~/.bashrc\n\nfunction startintent() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X shell am start $(1)\n}\n\nfunction apkinstall() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X \\\n      adb -s X install -r $(1)\n}\n\nfunction rmapp() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X uninstall $(1)\n}\n\nfunction clearapp() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X shell cmd package clear $(1)\n}\n```\n\u003c/details\u003e\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSimple for loop for dump global, secure, and system settings in one command\u003c/h2\u003e\u003c/summary\u003e\n  \n```bash\nfor options in system security global; do \n  settings list ${options}; \ndone\n```\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSetup and connect to the device via WiFi\u003c/h2\u003e\u003c/summary\u003e\n  \nThis requires that the USB cable is connected until you connect. Once connected via USB, copy and paste the following:\n\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\nport=\"5555\"\n\ninterface=$(adb shell ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'; )\nip=$(adb shell ifconfig ${interface} \\\n    |egrep  -o '(\\\u003c([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\u003e\\.){3}\\\u003c([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\u003e' 2\u003e /dev/null \\\n    |head -n 1)\n\nadb tcpip ${port};sleep 0.5\nadb connect $ip:${port}; sleep 1.0\nadb devices; adb shell\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eGrab all activities that are available via am start\u003c/h2\u003e\u003c/summary\u003e\n  \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\nfor package in $(cmd package list packages|cut -d: -f2); do \n    cmd package dump $package \\\n        |grep -i \"activ\" \\\n        |grep -Eo \"^[[:space:]]+[0-9a-f]+[[:space:]]+.*/[^[:space:]]+\" \\\n        |grep -oE \"[^[:space:]]+$\"; \ndone \u003e /tmp/full_activity_package_list.txt\n```\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eEnter Termux environment via ADB\u003c/h2\u003e\u003c/summary\u003e\n  \nSource: [rewida17 - termux](https://gist.githubusercontent.com/rewida17/f8564bee5a196a8f51b98cd2e53813e4/raw/6c1fbf160438e351c79238e976ee8e3c4bf4742d/termux)\n\n```bash\n#!/system/xbin/bash\n# Author: rewida17\n# Modded by: wuseman\n\nif [[ $(id -u) -ne \"0\" ]]; then \n  echo \"root is required\"; \n  exit\nelse\n  export PREFIX='/data/data/com.termux/files/usr'\n  export HOME='/data/data/com.termux/files/home'\n  export LD_LIBRARY_PATH='/data/data/com.termux/files/usr/lib'\n  export PATH=\"/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:$PATH\"\n  export LANG='en_US.UTF-8'\n  export SHELL='/data/data/com.termux/files/usr/bin/bash'\n  export BIN='/data/data/com.termux/files/usr/bin' \n  export TERM=vt220\n  export AR=\"arm-linux-androideabi-ar\"\n  export CPP=\"arm-linux-androideabi-cpp\"\n  export GCC=\"arm-linux-androideabi-gcc\"\n  export LD=\"arm-linux-androideabi-ld\"\n  export\n\n NM=\"arm-linux-androideabi-nm\"\n  export OBJDUMP=\"arm-linux-androideabi-objdump\"\n  export RANLIB=\"arm-linux-androideabi-ranlib\"\n  export READELF=\"arm-linux-androideabi-readelf\"\n  export STRIP=\"arm-linux-androideabi-strip\"\n  export TERMUX=\"/data/data/com.termux/\"\n\n  resize\n  cd \"$HOME\"\n  exec \"$SHELL\" -l\nfi\n```\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003ePrint esim via uiautomator\u003c/h2\u003e\u003c/summary\u003e\n  \nRead the screen via uiautomator and print IMEI for all active esim/sim cards on the device.\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\n### Launch IMEI (same result if you type in the caller app: *#06#) \n#### and dump screen to /tmp/read_screen.txt via uiautomator and parse esim IMEI:\n\nadb shell input keyevent KEYCODE_CALL;\nsleep 1;\ninput text '*#06#'; \nuiautomator dump --compressed /dev/stdout\\\n    |tr ' ' '\\n'\\\n    |awk -F'\"' '{print $2}'|grep \"^[0-9]\\{15\\}$\" \\\n    |nl -w 1 -s':'\\\n    |sed 's/^/IMEI/g'    \n```\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003ePrint Device screen state\u003c/h2\u003e\u003c/summary\u003e\n  \n```bash\nscreenState=\"$(adb shell dumpsys input_method \\\n   |grep -i \"mSystemReady=true mInteractive=\" \\\n   |awk -F= '{print $3}')\"\n\nif [[ $screenState = \"true\" ]]; then \n    echo \"Screen is on\"; \nelse \n    echo \"Screen is off\"; \nfi\n```\n\u003c/details\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eHow reboot works on Android\u003c/h2\u003e\u003c/summary\u003e\n\nReboot Commands:\n\n- Reboot to Bootloader:\n```bash\nadb reboot bootloader\n```\n\n- Reboot to Fastboot:\n```bash\nadb reboot fastboot\n```\n\n- Reboot to Recovery:\n```bash\nadb reboot recovery\n```\n\n- Reboot to System:\n```bash\nadb reboot\n```\n\nWhat is a hot and warm reboot?\n\nIn order to answer your question, we need to define what a hot (or warm) reboot is on an Android device. Terms cold (or hard) boot and warm (or soft) boot are more associated with PCs, particularly Windows. For mobile phones or embedded devices, it's difficult to draw a clear line between cold and warm boot. In the case of a cold reboot, power is usually cut to CPUs, RAM, and even the whole motherboard. A soft reboot only kills and starts the processes while retaining power to hardware components. Power management is part of the open-source ACPI/UEFI/BIOS standard on PCs, while on phones, PMIC firmware is usually used with SoCs.\n\nHow does reboot really work on Android?\n\nOn (re)boot, SoC firmware loads bootloaders in memory which then load executable binaries and start processes (the actual OS). Android is based on the Linux kernel, which is the very first executable of the operating system that runs during the boot process. The kernel initializes necessary hardware and prepares a basic environment before executing `init`, the very first userspace process we can see. It's `init` that then starts and takes care of all services and processes.\n\nA civilized way to reboot or shutdown is to let all processes terminate themselves, saving any pending work, unmounting filesystem\n\ns, and then ask the kernel to reverse the boot process. `init` can handle this on modern OSes, or you can do it manually through the `/proc/sysrq-trigger` interface. Alternatively, we can ask the kernel to perform a quick reboot by killing everything. However, this may cause data loss, particularly due to filesystem corruption.\n\nA brutal way is the long press of the power button (handled by PMIC), which is a cold reboot (or shutdown) in the true sense because the power to CPUs (and RAM) is suddenly cut without waiting for userspace processes and the kernel to terminate gracefully.\n\nDoes Android really perform a cold reboot?\n\nOn Android phones (and on other systems as well), a normal reboot is not completely cold as power is not cut, at least to RAM because it holds an area where kernel panic logs are stored, which can be accessed on the next boot (refer to ramoops used for last_kmsg or pstore). Similarly, some other memory regions allocated to SoC components and signed firmware that are isolated from the application processor (AP on which the main OS runs) may also not be erased. They include the Baseband Processor (modem), Digital Signal Processor (DSP), WiFi/BT module, etc.\n\nHowever, a normal reboot isn't a warm reboot either. During reboot, the kernel kills itself and hands over control to bootloaders, which may boot the device in different possible modes (fastboot/bootloader, recovery, or normal boot). The low-level details are vendor and hardware-specific, whether a device performs a complete power-on reset (PoR) or if the hardware is not reset at all. Which components are powered down during different types of reboots depends on the interaction between the kernel, bootloader, SoC, PMIC, watchdog hardware, etc.\n\nHow to do a hot reboot?\n\nThe Linux kernel also supports another form of warm reboot: `kexec`. The kernel can terminate userspace processes and itself, executing a new kernel which can then start a new userspace environment without doing a hardware reset, POST, and re-initialization by BIOS. This approach is theoretically possible on Android too, i.e., the kernel re-executes itself with the proper command line and then starts `init`. However, it requires some device-specific changes to the kernel and ROM.\n\nStock Android doesn't provide a soft reboot functionality, but some custom ROMs implement this feature by triggering the restart method of the activity service. However, `init` itself and other core daemons like ueventd, vold, installd, surfaceflinger, logd, servicemanager, healthd, and a long list of vendor daemons aren't restarted.\n\nTo restart the device, you can use the following commands:\n\n- On Android 9, the code for the restart method is `179`:\n```bash\nadb shell service call activity 179\n```\n\n- It's also possible to ask `init` to restart `zygote` and dependent services. However, SELinux won't let the property be set, so root access is required:\n```bash\nadb shell setprop ctl.restart zygote\n```\n\n\u003c/details\u003e\n\n\n\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eADB Shell / Fastboot install\u003c/h2\u003e\u003c/summary\u003e\n  \n  ### Arch Linux (pacman)\n  \n  ```bash\n  pacman -S android-tools\n  ```\n  \n  ### Debian Linux (apt)\n  \n  ```bash\n  apt install adb fastboot -y    \n  ```\n  \n  ### Gentoo Linux (portage)\n  ```bash\n  emerge --ask dev-util/android-sdk-update-manager dev-util/android-tools\n  ```\n  \n  ### Fedora Linux (dnf)\n  \n  ```bash\n  dnf install adb\n  ```\n  \n  ### GNU/Linux (source)\n  ```bash\n  1) Download the Android SDK Platform Tools ZIP file for Linux.\n  2) Extract the ZIP to an easily-accessible location (like the Desktop for example).\n  3) Open a Terminal window.\n  4) Enter the following command: cd /path/to/extracted/folder/\n  5) This will change the directory to where you extracted the ADB files.\n  6) So for example: cd /Users/Doug/Desktop/platform-tools/\n  7) Connect your device to your Linux machine with your USB cable. \n     Change the connection mode to “file transfer (MTP)” mode. \n     This is not always necessary for every device, but it’s recommended so you don’t run into any issues.\n  8) Once the Terminal is in the same folder your ADB tools are in, you can execute the following command to launch the ADB daemon: ./adb devices\n  9) Back on your smartphone or tablet device, you’ll see a prompt asking you to allow USB debugging. Go ahead and grant it.\n  ```\n  \n  ### Windows (source)\n  \n  ```bash\n  1) Download: https://dl.google.com/android/repository/platform-tools-latest-windows.zip\n  2) Extract the contents of this ZIP file into an\n\n easily accessible folder (such as C:\\platform-tools)\n  3) Open Windows explorer and browse to where you extracted the contents of this ZIP file\n  4) Then open up a Command Prompt from the same directory as this ADB binary. This can be done by holding \n       Shift and Right-clicking within the folder then click the “Open command window here” option. \n  5) Connect your smartphone or tablet to your computer with a USB cable. \n        Change the USB mode to “file transfer (MTP)” mode. Some OEMs may or may not require this, \n        but it’s best to just leave it in this mode for general compatibility.\n  6) In the Command Prompt window, enter the following command to launch the ADB daemon: adb devices\n  7) On your phone’s screen, you should see a prompt to allow or deny USB Debugging access. Naturally, \n        you will want to grant USB Debugging access when prompted (and tap the always allow check box if you never want to see that prompt again).\n  8) Finally, re-enter the command from step #6. If everything was successful,\n        you should now see your device’s serial number in the command prompt (or the PowerShell window).\n  ```\n  \n  ***\n  \n  ### Awesome Aliases For ADB\n  \n  Copy and paste to add the below aliases in ~/.bashrc\n  \n  ```bash\n  cat \u003c\u003c! \u003e\u003e ~/.bashrc\n\nfunction startintent() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X shell am start $(1)\n}\n\nfunction apkinstall() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X \\\n      adb -s X install -r $(1)\n}\n\nfunction rmapp() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X uninstall $(1)\n}\n\nfunction clearapp() {\n  adb devices \\\n    |tail -n +2 \\\n    |cut -sf 1 \\\n    |xargs -I X adb -s X shell cmd package clear $(1)\n}\n```\n\u003c/details\u003e\n  \n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSimple for loop for dump global, secure, and system settings in one command\u003c/h2\u003e\u003c/summary\u003e\n  \n```bash\nfor options in system security global; do \n  settings list ${options}; \ndone\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSetup and connect to the device via WiFi\u003c/h2\u003e\u003c/summary\u003e\n  \nThis requires that the USB cable is connected until you connect. Once connected via USB, copy and paste the following:\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\nport=\"5555\"\n\ninterface=$(adb shell ip addr | awk '/state UP/ {print $2}' | sed 's/.$//'; )\nip=$(adb shell ifconfig ${interface} \\\n    |egrep  -o '(\\\u003c([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\u003e\\.){3}\\\u003c([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\u003e' 2\u003e /dev/null \\\n    |head -n 1)\n\nadb tcpip ${port};sleep 0.5\nadb connect $ip:${port}; sleep 1.0\nadb devices; adb shell\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eGrab all activities that are available via am start\u003c/h2\u003e\u003c/summary\u003e\n  \n```bash\n#!/bin/bash\n# Author: wuseman\n\nfor package in $(cmd package list packages|cut -d: -f2); do \n    cmd package dump $package \\\n        |grep -i \"activ\" \\\n        |grep -Eo \"^[[:space:]]+[0-9a-f]+[[:space:]]+.*/[^[:space:]]+\" \\\n        |grep -oE \"[^[:space:]]+$\"; \ndone \u003e /tmp/full_activity_package_list.txt\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eEnter Termux environment via ADB\u003c/h2\u003e\u003c/summary\u003e\n  \nSource: [rewida17 - termux](https://gist.githubusercontent.com/rewida17/f8564bee5a196a8f51b98cd2e53813e4/raw/6c1fbf160438e351c79238e976ee8e3c4bf4742d/termux)\n\n```bash\n#!/system/xbin/bash\n# Author: rewida17\n# Modded by: wuseman\n\nif [[ $(id -u) -ne \"0\" ]]; then \n  echo \"root is required\"; \n  exit\nelse\n  export PREFIX='/data/data/com.termux/files/usr'\n  export HOME='/data/data/com.termux/files/home'\n  export LD_LIBRARY_PATH='/data/data/com.termux/files/usr/lib'\n  export PATH=\"/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:$PATH\"\n  export LANG='en_US.UTF-8'\n  export SHELL='/data/data/com.termux/files/usr/bin/bash'\n  export BIN='/data/data/com.termux/files/usr/bin' \n  export TERM=vt220\n  export AR=\"arm-linux-androideabi-ar\"\n  export CPP=\"arm-linux-androideabi-cpp\"\n  export GCC=\"arm-linux-androideabi-gcc\"\n  export LD=\"arm-linux-androideabi-ld\"\n  export\n\n NM=\"arm-linux-androideabi-nm\"\n  export OBJDUMP=\"arm-linux-androideabi-objdump\"\n  export RANLIB=\"arm-linux-androideabi-ranlib\"\n  export READELF=\"arm-linux-androideabi-readelf\"\n  export STRIP=\"arm-linux-androideabi-strip\"\n  export TERMUX=\"/data/data/com.termux/\"\n\n  resize\n  cd \"$HOME\"\n  exec \"$SHELL\" -l\nfi\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003ePrint esim via uiautomator\u003c/h2\u003e\u003c/summary\u003e\n  \nRead the screen via uiautomator and print IMEI for all active esim/sim cards on the device.\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\n### Launch IMEI (same result if you type in the caller app: *#06#) \n#### and dump screen to /tmp/read_screen.txt via uiautomator and parse esim IMEI:\n\nadb shell input keyevent KEYCODE_CALL;\nsleep 1;\ninput text '*#06#'; \nuiautomator dump --compressed /dev/stdout\\\n    |tr ' ' '\\n'\\\n    |awk -F'\"' '{print $2}'|grep \"^[0-9]\\{15\\}$\" \\\n    |nl -w 1 -s':'\\\n    |sed 's/^/IMEI/g'    \n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003ePrint Device screen state\u003c/h2\u003e\u003c/summary\u003e\n  \n```bash\nscreenState=\"$(adb shell dumpsys input_method \\\n   |grep -i \"mSystemReady=true mInteractive=\" \\\n   |awk -F= '{print $3}')\"\n\nif [[ $screenState = \"true\" ]]; then \n    echo \"Screen is on\"; \nelse \n    echo \"Screen is off\"; \nfi\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eHow reboot works on Android\u003c/h2\u003e\u003c/summary\u003e\n\nReboot Commands:\n\n- Reboot to Bootloader:\n```bash\nadb reboot bootloader\n```\n\n- Reboot to Fastboot:\n```bash\nadb reboot fastboot\n```\n\n- Reboot to Recovery:\n```bash\nadb reboot recovery\n```\n\n- Reboot to System:\n```bash\nadb reboot\n```\n\nWhat is a hot and warm reboot?\n\nIn order to answer your question, we need to define what a hot (or warm) reboot is on an Android device. Terms cold (or hard) boot and warm (or soft) boot are more associated with PCs, particularly Windows. For mobile phones or embedded devices, it's difficult to draw a clear line between cold and warm boot. In the case of a cold reboot, power is usually cut to CPUs, RAM, and even the whole motherboard. A soft reboot only kills and starts the processes while retaining power to hardware components. Power management is part of the open-source ACPI/UEFI/BIOS standard on PCs, while on phones, PMIC firmware is usually used with SoCs.\n\nHow does reboot really work on Android?\n\nOn (re)boot, SoC firmware loads bootloaders in memory which then load executable binaries and start processes (the actual OS). Android is based on the Linux kernel, which is the very first executable of the operating system that runs during the boot process. The kernel initializes necessary hardware and prepares a basic environment before executing `init`, the very first userspace process we can see. It's `init` that then starts and takes care of all services and processes.\n\nA civilized way to reboot or shutdown is to let all processes terminate themselves, saving any pending work, unmounting filesystem\n\ns, and then ask the kernel to reverse the boot process. `init` can handle this on modern OSes, or you can do it manually through the `/proc/sysrq-trigger` interface. Alternatively, we can ask the kernel to perform a quick reboot by killing everything. However, this may cause data loss, particularly due to filesystem corruption.\n\nA brutal way is the long press of the power button (handled by PMIC), which is a cold reboot (or shutdown) in the true sense because the power to CPUs (and RAM) is suddenly cut without waiting for userspace processes and the kernel to terminate gracefully.\n\nDoes Android really perform a cold reboot?\n\nOn Android phones (and on other systems as well), a normal reboot is not completely cold as power is not cut, at least to RAM because it holds an area where kernel panic logs are stored, which can be accessed on the next boot (refer to ramoops used for last_kmsg or pstore). Similarly, some other memory regions allocated to SoC components and signed firmware that are isolated from the application processor (AP on which the main OS runs) may also not be erased. They include the Baseband Processor (modem), Digital Signal Processor (DSP), WiFi/BT module, etc.\n\nHowever, a normal reboot isn't a warm reboot either. During reboot, the kernel kills itself and hands over control to bootloaders, which may boot the device in different possible modes (fastboot/bootloader, recovery, or normal boot). The low-level details are vendor and hardware-specific, whether a device performs a complete power-on reset (PoR) or if the hardware is not reset at all. Which components are powered down during different types of reboots depends on the interaction between the kernel, bootloader, SoC, PMIC, watchdog hardware, etc.\n\nHow to do a hot reboot?\n\nThe Linux kernel also supports another form of warm reboot: `kexec`. The kernel can terminate userspace processes and itself, executing a new kernel which can then start a new userspace environment without doing a hardware reset, POST, and re-initialization by BIOS. This approach is theoretically possible on Android too, i.e., the kernel re-executes itself with the proper command line and then starts `init`. However, it requires some device-specific changes to the kernel and ROM.\n\nStock Android doesn't provide a soft reboot functionality, but some custom ROMs implement this feature by triggering the restart method of the activity service. However, `init` itself and other core daemons like ueventd, vold, installd, surfaceflinger, logd, servicemanager, healthd, and a long list of vendor daemons aren't restarted.\n\nTo restart the device, you can use the following commands:\n\n- On Android 9, the code for the restart method is `179`:\n```bash\nadb shell service call activity 179\n```\n\n- It's also possible to ask `init` to restart `zygote` and dependent services. However, SELinux won't let the property be set, so root access is required:\n```bash\nadb shell setprop ctl.restart zygote\n```\n\n\u003c/details\u003e\n\n## acpi\n\nShow help for `acpi`:\n```bash\nadb shell acpi --help\n```\n\nPrint Battery Percentage:\n```bash\nadb shell acpi 2\u003e /dev/null\n```\n\nShow Cooling Device State:\n```bash\nadb shell 'su -c acpi -c'    \n```\n\nShow Temperatures:\n```bash\nadb shell acpi -t 2\u003e /dev/null\n```\n\nJust print everything from `acpi`:\n```bash\nadb shell acpi -V\n\n\n```\n\n## adb\n\nEnvironment variables:\n\n| Variable                        | Description                                                  |\n|---------------------------------|--------------------------------------------------------------|\n| `$ADB_TRACE`                    | List of debug info to log                                    |\n| `$ADB_VENDOR_KEYS`              | Colon Separated list of keys                                 |\n| `$ANDROID_SERIAL`               | Serial number to connect to                                  |\n| `$ANDROID_LOG_TAGS`             | Tags to be used by logcat                                    |\n| `$ADB_LOCAL_TRANSPORT_MAX_PORT` | Max emulator scan port                                       |\n| `$ADB_MDNS_AUTO_CONNECT`        | Comma Separated list of mdns services to allow auto-connect  |\n\nDebug Commands:\n\nCreate `bugreport.zip` in `/sdcard` path:\n```bash\nadb bugreport /sdcard\n```\n\nList pids of processes hosting a JDWP transport:\n```bash\nadb jdwp\n```\n\nShow device log (logcat --help for more):\n```bash\nadb logcat\n```\n\nSideload the given full OTA package:\n```bash\nadb sideload OTAPACKAGE\n```\n\nRestart `adbd` with root permissions:\n```bash\nadb root\n```\n\nRestart `adbd` without root permissions:\n```bash\nadb unroot\n```\n\nRestart `adbd` listening on USB:\n```bash\nadb usb\n```\n\nRestart `adbd` listening on TCP on `PORT`:\n```bash\nadb tcpip \u003cport\u003e\n```\n\nRestart userspace:\n```bash\nadb reboot userspace\n```\n\nInternal debugging:\n\nStart `adb` server:\n```bash\nadb start-server\n```\n\nKill `adb` server:\n```bash\nadb kill-server\n```\n\nStop `adb` server:\n```bash\nadb stop-server\n```\n\nKick connection from the host side to force reconnect:\n```bash\nadb reconnect\n```\n\nKick connection from the device side to force reconnect:\n```bash\nadb reconnect device\n```\n\nReset offline/unauthorized devices to force reconnect:\n```bash\nadb reconnect offline\n```\n\nUSB Commands:\n\nAttach a detached USB device:\n```bash\nadb attach\n```\n\nDetach from a USB device to allow use by others:\n```bash\nadb detach\n```\n\nShell Commands:\n\nEnter the device `shell`:\n```bash\nadb shell\n```\n\nChoose escape character or `\"none\"` (default '`~`'):\n```bash\nadb shell -e\n```\n\nDon't read from `stdin`:\n```bash\nadb shell -n\n```\n\nDisable pty allocation:\n```bash\nadb shell -T\n```\n\nAllocate a `pty` if on a `tty`:\n```bash\nadb shell -t\n```\n\nForce allocate a `pty` if on a `tty`:\n```bash\nadb shell -tt\n```\n\nDisable remote exit codes and `stdout/stderr` separation:\n```bash\nadb shell -x\n```\n\nRun `emulator` console command:\n```bash\nadb shell emu COMMAND\n```\n\nEnter the device shell when there is more than one device connected:\n\n- USB connected:\n```bash\nadb -s \u003cserial\u003e shell\n```\n\n- Network connected:\n```bash\nadb -s \u003cip:port\u003e shell\n```\n\nPrint connection status:\n```bash\nadb devices -l\n```\n\nPrint adb help:\n```bash\nadb help\n```\nPrint the currend:\n```bash\nadb version\n```\n\n\n## Network Commands\n\nConnect to a device via TCP/IP:\n\n```bash\nadb connect \u003cip:port\u003e\n```\n\nDisconnect all connected devices:\n\n```bash\nadb disconnect all\n```\n\nDisconnect from a given TCP/IP device:\n\n```bash\nadb disconnect \u003cip:port\u003e\n```\n\nPair with a device for secure TCP/IP communication:\n\n```bash\nadb pair \u003cip:port\u003e \u003cpairing code\u003e\n```\n\nList all forward socket connections:\n\n```bash\nadb forward --list\n```\n\nForward socket connection:\n\n- Port 0 = Any port\n\n```bash\nadb forward tcp:\u003cport\u003e\n```\n\n```bash\nadb forward localabstract:\u003csocket name\u003e\n```\n\n```bash\nadb forward localreserved:\u003csocket name\u003e\n```\n\n```bash\nadb forward localfilesystem:\u003csocket name\u003e\n```\n\n```bash\nadb forward jdwp:\u003cprocess pid\u003e (remote only)\n```\n\n```bash\nadb forward vsock:\u003cCID\u003e:\u003cport\u003e (remote only)\n```\n\n```bash\nadb forward acceptfd:\u003cfd\u003e (listen only)\n```\n\nRemove a specific forward socket connection:\n\n```bash\nadb forward --remove 'local/remote'\n```\n\nRemove all forward socket connections:\n\n```bash\nadb forward --remove-all\n```\n\nRun PPP over USB:\n\n```bash\nadb ppp TTY \u003cparameter\u003e\n```\n\nList all reverse socket connections:\n\n```bash\nadb reverse --list\n```\n\nReverse socket connection using:\n\n```bash\nadb reverse tcp:\u003cport\u003e\n```\n\n```bash\nadb reverse localabstract:\u003csocket name\u003e\n```\n\n```bash\nadb reverse localreserved:\u003csocket name\u003e\n```\n\n```bash\nadb reverse localfilesystem:\u003csocket name\u003e\n```\n\nRemove a specific reverse socket connection:\n\n```bash\nadb reverse --remove 'LOCAL/REMOTE'\n```\n\nRemove all reverse socket connections:\n\n```bash\nadb reverse --remove-all\n```\n\nCheck if mdns discovery is available:\n\n```bash\nadb mdns check\n```\n\nList all discovered services:\n\n```bash\nadb mdns services\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eSecurity Commands\u003c/h2\u003e\u003c/summary\u003e\n\nDisable dm-verity checking on userdebug builds:\n\n```bash\nadb disable-verity\n```\n\nRe-enable dm-verity checking on userdebug builds:\n\n```bash\nadb enable-verity\n```\n\nGenerate adb public/private key:\n\n```bash\nadb keygen \u003cfilename\u003e\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eScripting Commands\u003c/h2\u003e\u003c/summary\u003e\n\nWait for the device to be in a given state:\n\n- STATE: `device`, `recovery`, `rescue`, `sideload`, `bootloader`, or `disconnect`\n- TRANSPORT: `usb`, `local`, or any `[default=any]`\n\n```bash\nadb wait-for[-TRANSPORT]-STATE...\n```\n\nPrint the device state (offline|bootloader|device):\n\n```bash\nadb get-state\n```\n\nPrint the device serial number:\n\n```bash\nadb get-serialno\n```\n\nPrint dev path:\n\n```bash\nadb get-devpath\n```\n\nRemount partitions read-write:\n\n```bash\nadb remount -R\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eam (Activity Manager) Commands\u003c/h2\u003e\u003c/summary\u003e\n\nPrint all activities that we can launch for the preferred application:\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\ndumpsys package com.android.settings \\\n    |grep -Eo \"^[[:space:]]+[0-9a-f]+[[:space:]]+com.android.settings/[^[:space:]]+Activity\" \\\n    |grep -io\n\n com.* \\\n    |sed \"s/^/am start -n '/g\" \\\n    |sed \"s/$/'/g\"\n```\n\nPrint all activities that we can launch for all installed applications on the device:\n\n```bash\n#!/bin/bash\n# Author: wuseman\n\nfor packages in $(cmd package list packages|awk -F':' '{print $2}'|sort); do\n    dumpsys package ${packages} \\\n    |grep -Eo \"^[[:space:]]+[0-9a-f]+[[:space:]]+${packages}/[^[:space:]]+Activity\" \\\n    |grep -io com.* \\\n    |sed \"s/^/am start -n '/g\" \\\n    |sed \"s/$/'/g\" \\\n    |awk '!seen[$0]++'\ndone\n```\n\nDump all activities for all packages enabled on the device and store it in a file:\n\n```bash\nfor packages in $(cmd package list packages|awk -F':' '{print $2}'|sort); do\n    dumpsys package ${packages} \\\n    |grep -Eo \"^[[:space:]]+[0-9a-f]+[[:space:]]+${packages}/[^[:space:]]+Activity\" \\\n    |grep -io com.* \\\n    |sed \"s/^/am start -n '/g\" \\\n    |sed \"s/$/'/g\" \\\n    |awk '!seen[$0]++'\ndone \u003e /sdcard/wuseman/all_activitys_for_am.txt\n```\n\nLaunch an application and enter the activity section of the application's settings:\n\n```bash\nam start -n 'com.android.settings/.Settings$ApnSettingsActivity'\n```\n\nLaunch sysdump menu:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.SysDump\n```\n\nLaunch cp debug menu:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.CPDebugLevel\n```\n\nLaunch rtn view menu:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.RTN_View\n```\n\nLaunch RAMDUMP settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.CPDebugLevel\n```\n\nLaunch reset call time:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.ResetTotalCallTime\n```\n\nLaunch total call menu:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.TotalCallTime\n```\n\nLaunch wifi menu:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.WifiInfoActivity\n```\n\nLaunch NAND Flash:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/.NandFlashHeaderRead\n```\n\nLaunch modemui activities:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil\n```\n\nLaunch ESC settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_ESC\n```\n\nLaunch UART USBC TC settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.SetPortUartUSBCTCModel\n```\n\nLaunch SGLTE settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_SGLTE\n```\n\nLaunch TD settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_TD\n```\n\nLaunch MarvellVIA settings:\n\n```bash\nadb shell am start\n\n com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_MarvellVIA\n```\n\nLaunch BCOM settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_Bcom\n```\n\nLaunch and show IMEI activity:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.ShowIMEI\n```\n\nLaunch UART USB MSM8960 Port settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.SetPortUartUsbMSM8960\n```\n\nLaunch MDM 9x15 settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.PhoneUtil_MDM9x15\n```\n\nLaunch USB Settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.USBSettings\n```\n\nLaunch auto answer settings:\n\n```bash\nadb shell am start com.sec.android.app.servicemodeapp/com.sec.android.app.modemui.activities.AutoAnswer\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eadb Shell Commands\u003c/h2\u003e\u003c/summary\u003e\n\nEnter the device shell:\n\n```bash\nadb shell\n```\n\nChoose an escape character or \"none\" (default: '~'):\n\n```bash\nadb shell -e\n```\n\nDon't read from stdin:\n\n```bash\nadb shell -n\n```\n\nDisable pty allocation:\n\n```bash\nadb shell -T\n```\n\nAllocate a pty if on a tty:\n\n```bash\nadb shell -t\n```\n\nForce allocate a pty if on a tty:\n\n```bash\nadb shell -tt\n```\n\nDisable remote exit codes and stdout/stderr separation:\n\n```bash\nadb shell -x\n```\n\nRun emulator console command:\n\n```bash\nadb shell emu COMMAND\n```\n\nEnter the device shell when there is more than one device connected:\n\n- USB connected:\n\n```bash\nadb -s \u003cserial\u003e shell\n```\n\n- Network connected:\n\n```bash\nadb -s \u003cip:port\u003e shell\n```\n\nPrint the connection status:\n\n```bash\nadb devices -l\n```\n\nPrint adb help:\n\n```bash\nadb help\n```\n\nPrint the current adb version installed:\n\n```bash\nadb version\n```\n\n\u003c/details\u003e\n\nThe provided commands allow you to perform various actions related to the `com.google.android.gms` package, launch different settings and activities, and interact with other applications. Here are the commands:\n\nLaunch Find My Device settings:\n\n```bash\nadb shell am start -n com.google.android.gms/.mdm.settings.FindMyDeviceSettingsActivity\n```\n\nLaunch Nearby Sharing settings:\n\n```bash\nadb shell am start -n com.google.android.gms/.nearby.sharing.ReceiveSurfaceActivity\n```\n\nLaunch Personal Google Setup (requires root):\n\n```bash\nadb shell su -c am start com.google.android.gms/.accountsettings.mg.ui.main.MainActivity\n```\n\nLaunch hidden settings for SMS verification codes (requires root):\n\n```bash\nadb shell su -c am start com.google.android.gms/.auth.api.phone.ui.AutofillSettingsCollapsingActivity\n```\n\nSet wallpaper for the current image opened:\n\n```bash\nadb shell am start -a android.intent.action.SET_WALLPAPER\n```\n\nOpen SIM ID settings for APN:\n\n```bash\nadb shell am start -a android.intent.action.INSERT -d content://telephony/carriers --ei simId\n```\n\nLaunch default action view:\n\n```bash\nadb shell am start -a android.intent.action.VIEW\n```\n\nOpen the default browser and visit a URL:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d https://www.example.com\n```\n\nLaunch Google Maps with fixed coordinates:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d \"geo:46.457398,-119.407305\"\n```\n\nLaunch Facebook inbox URI:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d facebook://facebook.com/inbox\n```\n\nOpen a vCard file from the SD card:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d file:///sdcard/me.vcard -t text/x-vcard\n```\n\nLaunch the default music player and play a file:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d file:////storage/9A8A-1069/wuseman/ringtones/\u003cmp3_track\u003e.mp3 -t audio/mp3\n```\n\nLaunch the default video player and play a file:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d file:///sdcard/sound.ogg -t audio/ogg\n```\n\nLaunch the default video player and play a video file:\n\n```bash\nadb shell am start -a android.intent.action.VIEW -d file:///sdcard/video.mkv -t video/mkv\n```\n\nLaunch Android settings:\n\n```bash\nadb shell am start -n com.android.settings/com.android.settings.Settings\n```\n\nLaunch Android sub-settings:\n\n```bash\nadb shell am start com.android.settings/com.android.settings.SubSettings\n```\n\nOpen the camera in photo mode:\n\n```bash\nadb shell am start -a android.media.action.IMAGE_CAPTURE\n```\n\nOpen the camera app in video mode:\n\n```bash\nadb shell am start -a android.media.action.VIDEO_CAMERA\n```\n\nOpen the camera app in QR mode:\n\n```bash\nadb shell am start -n 'com.sec.android.app.camera/.QrScannerActivity'\n```\n\nOpen My Files (file manager):\n\n```bash\nadb shell am start com.sec.android.app.myfiles/com.sec.android.app.myfiles.external.ui.MainActivity\n```\n\nOpen SIM card settings from the setup wizard:\n\n```bash\nsu -c am start -n 'com.sec.android.app.SecSetupWizard/.UI.SimTssSetupActivity'\n```\n\nOpen the last page in the setup wizard that indicates everything has been done:\n\n```bash\nsu -c am start -n '\n\ncom.sec.android.app.SecSetupWizard/.UI.OutroActivity'\n```\n\nOpen the last page in the setup wizard with the spinning bar:\n\n```bash\nsu -c am start -n 'com.sec.android.app.SecSetupWizard/.kme.B2bDeviceCheckActivity'\n```\n\nOpen Samsung Features window from the setup wizard:\n\n```bash\nsu -c am start -n 'com.sec.android.app.SecSetupWizard/.UI.AlternativePermissionActivity'\n```\n\nOpen Take Care of Your Device window from the setup wizard:\n\n```bash\nsu -c am start -n 'com.sec.android.app.SecSetupWizard/.UI.NoticeActivity'\n```\n\nOpen the language window from the setup wizard:\n\n```bash\nsu -c am start -n 'com.sec.android.app.SecSetupWizard/.UI.LanguageSelectionActivity'\n```\n\nSend a simple notification:\n\n```bash\nadb shell am broadcast -n your.package.name/com.google.firebase.iid.FirebaseInstanceIdReceiver -c your.package.name -a com.google.android.c2dm.intent.RECEIVE\n```\n\nSend a notification:\n\n```bash\nadb shell am broadcast -n com.android.google.youtube/com.google.firebase.iid.FirebaseInstanceIdReceiver -a \"com.google.android.c2dm.intent.RECEIVE\" -es \"title\" \"Title\" --es \"body\" \"Body\"\n```\n\nBroadcast a push notification locally using ADB without a network connection:\n\n```bash\nadb shell am broadcast -n com.your.app/com.google.firebase.iid.FirebaseInstanceIdReceiver -a \"com.google.android.c2dm.intent.RECEIVE\" --es \"extra1\" \"65\" --es \"guid\" \"1f400184-9215-479c-b19a-a9cd9a1d9dc9\" --es \"extra3\" \"VALUE\" --es \"extra4\" \"'Long string with spaces'\"\n```\n\nAdd a value to the default shared preferences:\n\n```bash\nadb shell am broadcast -a org.example.app.sp.PUT --es key key_name --es value \"hello world!\"\n```\n\nRemove a value from the default shared preferences:\n\n```bash\nadb shell am broadcast -a org.example.app.sp.REMOVE --es key key_name\n```\n\nClear all default shared preferences:\n\n```bash\nadb shell am broadcast -a org.example.app.sp.CLEAR --es key key_name\n```\n\nRestart the application process after making changes:\n\n```bash\nadb shell am broadcast -a org.example.app.sp.CLEAR --ez restart true\n```\n\nSet default preferences for an app:\n\n```bash\nadb shell am broadcast -a org.example.app.sp.CLEAR --es key key_name\n```\n\nFactory reset your device after the next reboot:\n\n```bash\nadb shell am broadcast -a android.intent.action.MASTER_CLEAR\nreboot\n```\n\nLaunch the Launcher activities (requires root):\n\n```bash\nadb shell am start com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity\n```\n\nLaunch the homescreen (requires root):\n\n```bash\nadb shell am start com.sec.android.app.launcher/com.android.launcher3.uioverrides.QuickstepLauncher\n```\n\n  Here are some additional ADB shell commands:\n\nOpen hidden menu and select \"enable\":\n\n```bash\nadb shell \"su -c am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://HIDDENMENUENABLE\"\n```\n\nOpen internal operation test menu:\n\n```bash\nadb shell \"su -c am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://IOTHIDDENMENU\"\n```\n\nOpen a dialog box followed by another dialog asking for the unlock key code:\n\n```bash\nadb shell \"su -c am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://UNLOCKKERNEL\"\n```\n\nSend an SMS:\n\n```bash\nadb shell am broadcast -a com.whereismywifeserver.intent.TEST --es sms_body \"test from adb\"\n```\n\nTrigger test GSM cell broadcasts:\n\n```bash\nadb shell am broadcast -a com.android.internal.telephony.gsm.TEST_TRIGGER_CELL_BROADCAST --es pdu_string \u003cpdu_string\u003e\n```\n\nSimulate wake mode:\n\n```bash\nadb shell am set-inactive \u003cpackageName\u003e\nadb shell am set-inactive \u003cpackageName\u003e false\n```\n\nEnable Demo Mode:\n\n```bash\nadb shell settings put global sysui_demo_allowed 1\n```\n\nEnable car dialer:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb -es \"action\" \"connect\"\n```\n\nMake a call:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"addCall\" --es \"id\" \"4085524874\"\n```\n\nReceive an incoming call:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"rcvCall\" --es \"id\" \"4085524874\"\n```\n\nMerge calls:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"unholdCall\"\n```\n\nHold a call:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"holdCall\"\n```\n\nUnhold a call:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"unholdCall\"\n```\n\nEnd a call:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"endCall\" --es \"id\" \"4085524874\"\n```\n\nClear call history:\n\n```bash\nadb shell am broadcast -a com.android.car.dialer.intent.action.adb --es \"action\" \"clearAll\"\n```\n\nPress home and print call status:\n\n```bash\nadb shell am start -W -c android.intent.category.HOME -a android.intent.action.MAIN\n```\n\nDisplay time in `hhmm` format:\n\n```bash\nadb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200\n```\n\nPrint network data type:\n\n```bash\nadb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false\n```\n\nHide notifications:\n\n```bash\nadb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false\n```\n\nRestart the system service:\n\n```bash\nadb shell am startservice -n com.android.systemui/.SystemUIService\n```\n\nOpen Google Camera (Pixel 4):\n\n```bash\nadb shell am start com.google.android.GoogleCamera\n```\n\nFind all available modes to launch in GUI (Samsung):\n\n```bash\n\n\nadb shell cmd package dump com.samsung.android.app.telephonyui | grep \"Activity filter\" | awk '{print $2}' | awk '!seen[$0]++'\n```\n\nLaunch Samsung Dialer:\n\n```bash\nadb shell am start com.samsung.android.dialer/.DialtactsActivity\n```\n\nLaunch Samsung SMS application:\n\n```bash\nadb shell am start com.samsung.android.messaging/com.samsung.android.messaging.ui.view.setting.MainSettingActivity\n```\n\nLaunch Samsung Messenger conversation composer:\n\n```bash\nadb shell am start com.samsung.android.messaging/com.android.mms.ui.ConversationComposer\n```\n\nLaunch Samsung Messenger in contacts view:\n\n```bash\nadb shell am start com.samsung.android.messaging/com.samsung.android.messaging.ui.view.recipientspicker.PickerActivity\n```\n\nLaunch Samsung Messenger with recent activity:\n\n```bash\nadb shell am start com.samsung.android.dialer/com.samsung.android.dialer.calllog.view.picker.CallLogPickerActivity\n```\n\nLaunch Samsung Gallery:\n\n```bash\nadb shell am start com.sec.android.gallery3d/com.samsung.android.gallery.app.activity.GalleryActivity\n```\n\nLaunch secret project menu (Huawei only):\n\n```bash\nadb shell am start com.huawei.android.projectmenu/com.huawei.android.projectmenu.ProjectMenuActivity\n```\n\nSet the application run in the background behavior:\n\n```bash\nadb shell cmd appops set \u003cpackage_name\u003e RUN_IN_BACKGROUND ignore\n```\n\nSet any application run in the background behavior:\n\n```bash\nadb shell cmd appops set \u003cpackage_name\u003e RUN_ANY_IN_BACKGROUND ignore\n```\n\nSet the application to launch in the foreground:\n\n```bash\nadb shell cmd appops set \u003cpackage_name\u003e START_FOREGROUND ignore\n```\n\nSet the application settings for instant launch in the foreground:\n\n```bash\nadb shell cmd appops set \u003cpackage_name\u003e INSTANT_APP_START_FOREGROUND ignore\n```\n\nSet application permission for clipboard:\n\n```bash\nadb shell cmd appops set \u003cpackagename\u003e READ_CLIPBOARD allow\n```\n\nPaste clipboard:\n\n```bash\nadb shell input keyevent PASTE\n```\n\nSet application with read permissions for the clipboard:\n\n```bash\nadb cmd appops set com.bankid.bus READ_CLIPBOARD allow\n```\n\nAdd text to clipboard:\n\n```bash\nam broadcast -a clipper.set -e text \"text\"\n```\n\nGet airplane mode status:\n\n```bash\nadb shell cmd connectivity airplane-mode\n```\n\nSet airplane mode (enable/disable):\n\n```bash\nadb shell cmd connectivity airplane-mode enable|disable\n```\n\nSend notify and push notice to the notification bar:\n\n```bash\nadb shell su -lp 2000 -c \"cmd notification post -S bigtext -t 'adb pwnz' 'Tag' 'it rly does'\"\n```\n\nSet resume on reboot provider package:\n\n```bash\nadb shell cmd lock_settings set-resume-on-reboot-provider-package \u003cpackage_name\u003e\n```\n\nRemove cached unified challenge for the managed profile:\n\n```bash\nadb shell cmd lock_settings remove-cache --user 0\n```\n\nVerify the lock credentials:\n\n```bash\nadb shell cmd lock_settings verify --old 1234 --user 0\n```\n\nClear the lock credentials:\n\n```bash\nadb shell cmd lock_settings clear --old 1234 --user 0\n```\n\nEnable/disable synthetic password:\n\n```bash\nadb shell cmd lock_settings sp --old 1234 --user 0 \u003c1|0\u003e\n```\n\nGet whether synthetic password is enabled:\n\n```bash\nadb shell cmd lock_settings sp --old 1234 --user 0\n```\n\nSet the lock screen as a password using the given password to unlock:\n\n```bash\nadb shell cmd lock_settings set-password --old 1234 --user 0\n\n 'newPassword'\n```\n\nSet the lock screen as a PIN using the given PIN to unlock:\n\n```bash\nadb shell cmd lock_settings set-pin --old 1234 --user 0 'newPin'\n```\n\nSet the lock screen as a pattern using the given pattern to unlock:\n\n```bash\nadb shell cmd lock_settings set-pattern --old 1234 --user 0 'newPattern'\n```\n\nWhen true, disable lock screen:\n\n```bash\nadb shell cmd lock_settings set-disabled --old 1234 --user 0 true|false\n```\n\nCheck whether the lock screen is disabled:\n\n```bash\nadb shell cmd lock_settings get-disabled --old 1234 --user 0\n```\n\nPrint stats:\n\n```bash\nadb shell cmd stats print-stats\n```\n\nSend a broadcast that triggers the subscriber to fetch metrics:\n\n```bash\nadb shell cmd stats send-broadcast uid name\n```\n\nFlush all data in memory to disk:\n\n```bash\nadb shell cmd stats write-to-disk\n```\n\nPrint the UID, app name, version mapping:\n\n```bash\nadb shell cmd stats print-uid-map\n```\n\nLog a binary push state changed event:\n\n```bash\nadb shell cmd stats log-binary-push NAME VERSION STAGING ROLLBACK_ENABLED LOW_LATENCY STATE EXPERIMENT_IDS\n```\n\nHide all notification icons on the status bar:\n\n```bash\nadb shell cmd statusbar send-disable-flag notification-icons\n```\n\nReset all flags to default:\n\n```bash\nadb shell cmd statusbar send-disable-flag none\n```\n\nPrint status bar icons:\n\n```bash\nadb shell cmd statusbar get-status-icons\n```\n\nPrint preferences for the status bar:\n\n```bash\nadb shell cmd statusbar prefs list-prefs\n```\n\nExpand the status bar:\n\n```bash\nadb shell cmd statusbar expand-notifications\n```\n\nCollapse the status bar:\n\n```bash\nadb shell cmd statusbar collapse\n```\n\nExpand full settings:\n\n```bash\nadb shell cmd statusbar expand-settings\n```\n\nGet the auth user:\n\n```bash\nadb shell cmd user list\n```\n\nHere are some additional commands related to UI mode, Wi-Fi, media session, package management, and app operations:\n\nEnable night mode (Dark Mode):\n```bash\nadb shell cmd uimode night yes\n```\n\nDisable night mode:\n```bash\nadb shell cmd uimode night no\n```\n\nEnable car mode:\n```bash\nadb shell cmd uimode car yes\n```\n\nDisable car mode:\n```bash\nadb shell cmd uimode car no\n```\n\nScan for nearby SSIDs and fetch Wi-Fi data:\n```bash\n#!/bin/bash\n\nadb shell cmd -w wifi start-scan\nsleep 7\nadb shell cmd -w wifi list-scan-results\n```\n\nSets whether we are in the middle of an emergency call:\n```bash\nadb shell cmd -w wifi set-emergency-call-state enabled|disabled\n```\n\nSets whether Emergency Callback Mode (ECBM) is enabled:\n```bash\nadb shell cmd -w wifi set-emergency-callback-mode enabled|disabled\n```\n\nLists the suggested networks from the app:\n```bash\nadb shell cmd -w wifi list-suggestions-from-app com.app.example\n```\n\nLists all suggested networks on this device:\n```bash\nadb shell cmd -w wifi list-all-suggestions\n```\n\nQueries whether network requests from the app are approved or not:\n```bash\nadb shell cmd -w wifi network-requests-has-user-approved com.app.example\n```\n\nSets whether network requests from the app are approved or not:\n```bash\nadb shell cmd -w wifi network-requests-set-user-approved com.app.example yes|no\n```\n\nLists the requested networks added via the shell:\n```bash\nadb shell cmd -w wifi list-requests\n```\n\nRemoves all active requests added via the shell:\n```bash\nadb shell cmd -w wifi remove-all-requests\n```\n\nRemove a network request with the provided SSID of the network:\n```bash\nadb shell cmd -w wifi remove-request \u003cssid\u003e\n```\n\nAdd a network request with the provided parameters:\n```bash\nadb shell cmd -w wifi add-request \u003cssid\u003e open|owe|wpa2|wpa3 [\u003cpassphrase\u003e] [-b \u003cbssid\u003e]\n```\n\nInitiates Wi-Fi settings reset:\n```bash\nadb shell cmd -w wifi settings-reset\n```\n\nGets soft AP supported features:\n```bash\nadb shell cmd -w wifi get-softap-supported-features\n```\n\nSets whether Wi-Fi watchdog should trigger recovery:\n```bash\nadb shell cmd -w wifi set-wifi-watchdog enabled|disabled\n```\n\nSets country code to `\u003ctwo-letter code\u003e` or left for normal value:\n```bash\nadb shell cmd -w wifi force-country-code enabled \u003ctwo-letter code\u003e | disabled\n```\n\nManually triggers a link probe:\n```bash\nadb shell cmd -w wifi send-link-probe\n```\n\nClears the user-disabled networks list:\n```bash\nadb shell cmd -w wifi clear-user-disabled-networks\n```\n\nRemoves all user-approved network requests for the app:\n```bash\nadb shell cmd -w wifi network-requests-remove-user-approved-access-points com.app.example\n```\n\nClear the user choice on Imsi protection exemption for the carrier:\n```bash\nadb shell cmd -w wifi imsi-protection-exemption-clear-user-approved-for-carrier \u003ccarrier id\u003e\n```\n\nQueries whether Imsi protection exemption for the carrier is approved or not:\n```bash\nadb shell cmd -w wifi imsi-protection-exemption-has-user-approved-for-carrier \u003ccarrier id\u003e\n```\n\nSets whether Imsi protection exemption for the carrier is approved or not:\n```bash\nadb shell cmd -w wifi imsi-protection-exemption-set-user-approved-for\n\n-carrier \u003ccarrier id\u003e yes|no\n```\n\nPrint all available apps that can be manually started from the activity manager:\n```bash\nadb shell cmd package dump com.android.com | grep \"Activity filter\" | awk '{print $2}'\n```\n\nList UID owner of a package:\n```bash\nadb shell cmd package list packages -U\n```\n\nPrint all applications sorted by alpha:\n```bash\nadb shell cmd package list packages | awk -F: '{print $2}' | sort\n```\n\nList packages:\n```bash\nadb shell cmd package list packages -l\n```\n\nList disabled packages:\n```bash\nadb shell cmd package list packages -d\n```\n\nFilter to only show enabled packages:\n```bash\nadb shell cmd package list packages -e\n```\n\nFilter to only show third-party packages:\n```bash\nadb shell cmd package list packages -3\n```\n\nSet the default home activity (aka launcher):\n```bash\nadb shell cmd package set-home-activity [--user USER_ID] TARGET-COMPONENT\n```\n\nPrint all features of the system:\n```bash\nadb shell cmd package list features\n```\n\nPrint briefs:\n```bash\nadb shell cmd package resolve-activity --brief com.facebook.katana\n```\n\nConnect to AudioService:\n```bash\nadb shell cmd media_session volume\n```\n\nSet the volume of media to a value (0-15):\n```bash\nadb shell media volume --show --stream 3 --set N\n```\n\nSet fine volume in Samsung devices (0-150):\n```bash\nadb shell cmd media_session volume --show --setfine 150\n```\n\nControl the stream (3=STREAM_MUSIC) and set the volume index to 11:\n```bash\nadb shell cmd media_session volume --show --stream 3 --set 11\n```\n\nPrint the current volume from all streams:\n```bash\nadb shell cmd media_session volume --get\n```\n\nPrint the current volume range from stream 3:\n```bash\nadb shell cmd media_session volume --stream 3 --get\n```\n\nPrint the current fine volume:\n```bash\nadb shell cmd media_session volume --getfine\n```\n\nIncrease media volume:\n```bash\nadb shell cmd media_session volume --show --adj raise\n```\n\nDecrease media volume:\n```bash\nadb shell cmd media_session volume --show --adj lower\n```\n\nPrint the current volume (1-15):\n```bash\nadb shell cmd media_session volume --get\n```\n\nPrint a list of current media sessions:\n```bash\nadb shell cmd media_session list-sessions\n```\n\nMonitor updates to the specified session (use tag output from list-sessions):\n```bash\ncmd media_session monitor spotify-media-session\n```\n\nSet application run-in-background behavior:\n```bash\ncmd appops set \u003cpackage_name\u003e RUN_IN_BACKGROUND ignore\n```\n\nSet any application run-in-background behavior:\n```bash\ncmd appops set \u003cpackage_name\u003e RUN_ANY_IN_BACKGROUND ignore\n```\n\nSet application to launch in the foreground:\n```bash\ncmd appops set \u003cpackage_name\u003e START_FOREGROUND ignore\n```\n\nSet application settings for instant launch in the foreground:\n```bash\ncmd appops set \u003cpackage_name\u003e INSTANT_APP_START_FOREGROUND ignore\n```\n\nSet application permission for clipboard:\n```bash\ncmd appops set \u003cpackagename\u003e READ_CLIPBOARD allow\n```\n\nPlease note that some commands may require root access or specific privileges.\n\nHere are some additional commands related to media dispatch and content management:\n\nDispatch media commands:\n\nPress `play` key:\n```bash\nadb shell cmd media_session dispatch play\n```\n\nDispatch `pause`:\n```bash\nadb shell cmd media_session dispatch pause\n```\n\nDispatch `play-pause`:\n```bash\nadb shell cmd media_session dispatch play-pause\n```\n\nDispatch `mute`:\n```bash\nadb shell cmd media_session dispatch mute\n```\n\nDispatch `headsethook`:\n```bash\nadb shell cmd media_session dispatch headsethook\n```\n\nDispatch `stop`:\n```bash\nadb shell cmd media_session dispatch stop\n```\n\nDispatch `next`:\n```bash\nadb shell cmd media_session dispatch next\n```\n\nDispatch `previous`:\n```bash\nadb shell cmd media_session dispatch previous\n```\n\nDispatch `rewind`:\n```bash\nadb shell cmd media_session dispatch rewind\n```\n\nDispatch `record`:\n```bash\nadb shell cmd media_session dispatch record\n```\n\nDispatch `fast-forward`:\n```bash\nadb shell cmd media_session dispatch fast-forward\n```\n\nContent management:\n\nFind contents in SDK map and create samples for this cheatsheet:\n```bash\nrg . | rg 'content://.*\"' -o | cut -d '\"' -f1 | sed 's/^/adb shell content query --uri /g' | sed 'i### Print\\''\n```\n\nFind contents in SDK map and create samples for this cheatsheet:\n```bash\nadb shell \"su -c content query --uri content://com.samsung.rcs.autoconfigurationprovider/root/* | tr ' ' '\\n'\"\n```\n\nPrint device number:\n```bash\nadb shell \"su -c content query --uri content://com.samsung.rcs.autoconfigurationprovider/root/application/1/im/fthttpcsuser\"\n```\n\nDelete a certain setting:\n```bash\nadb shell content delete --uri content://settings/secure --where \"name='new_setting'\"\n```\n\nInsert a setting and value to foo:\n```bash\nadb shell content insert --uri content://settings/secure --bind name:s:user_setup_complete --bind value:s:1\n```\n\nChange setting to another setting:\n```bash\nadb shell content update --uri content://settings/secure --bind value:s:newer_value --where \"name='new_setting'\"\n```\n\nSelect \"name\" and \"value\" columns from secure settings where \"name\" is equal to \"new_setting\" and sort the result by name in ascending order:\n```bash\nadb shell content query --uri content://settings/secure --projection name:value --where \"name='new_setting'\" --sort \"name ASC\"\n```\n\nRead and redirect file:\n```bash\nadb shell 'content read --uri content://settings/system/ringtone_cache' \u003e foo.ogg\n```\n\nSet ringtone:\n```bash\nadb shell 'content write --uri content://settings/system/ringtone_cache' \u003c host.ogg\n```\n\nPrint current type for a content:\n```bash\nadb shell content gettype --uri content://media/internal/audio/media/\n```\n\nPrint cell broadcasts, call logs, downloads, contacts, MMS, and more:\n\nPrint cell broadcasts:\n```bash\nadb shell content query --uri content://cellbroadcasts\n```\n\nPrint call logs:\n```bash\nadb shell content query --uri content://call_log/calls\n```\n\nPrint downloads:\n```bash\nadb shell content query --uri content://downloads/my_downloads\n```\n\nPrint contacts:\n```bash\nadb shell content query --uri content://contacts/people\n```\n\nPrint MMS:\n```bash\nadb shell content query --uri content://mms\n```\n\nPrint SMS:\n```bash\nadb shell content query --uri content://sms\n\n\nPrint device carriers:\n```bash\nadb shell su -c content query --uri content://telephony/carriers\n```\n\n## ffplay\n\n### Stream via FFplay \n\nFFPlay Default - No Settings\n\n```bash\nadb shell screenrecord --Example Output-format=h264 - | ffplay -\n```\n\nFFplay Customized\n\n```bash\nadb exec-out screenrecord |    --Example Output-format=h264 - |        |ffplay |        -framerate 60 |        -probesize 32 |        -sync video  -\n```\n\n```bash\nadb shell screenrecord |    --bit-rate=16m |    --Example Output-format=h264 |    --size 800x600 - |        |ffplay |        -framerate 60 |        -framedrop |        -bufsize 16M -\n```\n\nFFplay Customized - Stream in 1080p quality\n\n```bash\nadb exec-out screenrecord |    --bit-rate=16m |    --Example Output-format=h264 |    --size 1920x1080 -\n```\n\n## getprop\n\nUse the `getprop` command to get system properties.\n\n### Example Usage\n\n```bash\nadb shell getprop | egrep \"model|version.sdk|manufacturer|hardware|platform|revision|serialno|product.name|brand\" 2\u003e/dev/null\n```\n\nPrint CPU ABI\n\n```bash\nadb shell getprop ro.product.cpu.abi\n```\n\nGet info if OEM Unlock is Allowed\n\n```\n1 = Enabled\n0 = Disabled\n```\n\n```bash\nadb shell getprop sys.oem_unlock_allowed \n```\n\nIs System boot completed\n\n```bash\nadb shell getprop sys.boot_completed\n```\n\n\n## input tap \n\n```bash\nOrigin (0, 0)\n+----------------------------------+\n|  Status Bar   (500,0) X         |\n|----------------------------------+\n|                                  |\n|                                  |\n|                                  |\n|  (100,1150) O                    |\n|                                  |\n|                                  |\n|                                  |\n|                                  |\n|                                  | ---- O (250,1150)\n|                                  |\n|                                  |\n|                                  |\n|                                  |\n|                                  || --- Power Button\n|                                  |\n|                                  |\n|                                  |\n|                                  |\n|                                  |\n|                                  |\n|                                  || ---- O (1000,1000)\n|                                  |\n|                                  |\n|              Antenna             |\n|(0,2300) X                        |\n------------------------------------ ---- Y(2300)\n           100       300      500\n\n```\n\nIn this ASCII art:\n- `(500,0)` marks the top-right corner of the screen.\n- `(0,2300)` marks the bottom-left corner of the screen.\n- `(100,1150)` marks a location towards the left-middle of the screen.\n- `(250,1150)` marks a location at the middle of the screen.\n- `(1000,1000)` marks a location a bit lower but more towards the right side.\n\n\n- To tap on the center of the screen:\n  ```\n  adb shell input tap 250 1150\n  ```\n\n- To tap on the Power button:\n  ```\n  adb shell input tap 150 350\n  ```\n\n- To tap on the top-right corner of the screen:\n  ```\n  adb shell input tap 500 0\n  ```\n\n- To tap on the bottom-left corner of the screen:\n  ```\n  adb shell input tap 0 2300\n  ```\n\n- To tap on the middle-left of the screen:\n  ```\n  adb shell input tap 100 1150\n  ```\n\n- To tap on the middle-right of the screen:\n  ```\n  adb shell input tap 400 1150\n  ```\n\n- To simulate a swipe from the middle of the screen to the top (useful for scrolling):\n  ```\n  adb shell input swipe 250 1150 250 300\n  ```\n\n- To simulate a swipe from the middle of the screen to the bottom (also for scrolling):\n  ```\n  adb shell input swipe 250 1150 250 2000\n  ```\n\n- To simulate a long press at the middle of the screen (for context menus or similar functionality):\n  ```\n  adb shell input swipe 250 1150 250 1150 2000\n  ```\n\n- To simulate a pinch gesture (zoom out), we can use two swipe commands that start from different points and converge in the middle of the screen:\n  ```\n  adb shell input swipe 100 1000 250 1150 \u0026 adb shell input swipe 400 1300 250 1150\n  ```\n\n- To simulate a spread gesture (zoom in), we can use two swipe commands that start from the same point in the middle of the screen and move towards different ends:\n  ```\n  adb shell input swipe 250 1150 100 1000 \u0026 adb shell input swipe 250 1150 400 1300\n  ```\n\n\n- To tap on the top-left corner of the screen:\n    ```\n    adb shell input tap 0 0\n    ```\n\n- To tap on the bottom-right corner of the screen:\n    ```\n    adb shell input tap 500 2300\n    ```\n\n- To simulate a swipe from the bottom to the top of the screen (reverse scrolling):\n    ```\n    adb shell input swipe 250 2000 250 300\n    ```\n\n- To simulate a swipe from top to the bottom of the screen (reverse scrolling):\n    ```\n    adb shell input swipe 250 300 250 2000\n    ```\n\n- To simulate a long press at the top-left of the screen:\n    ```\n    adb shell input swipe 0 0 0 0 2000\n    ```\n\n- To simulate a long press at the bottom-right of the screen:\n    ```\n    adb shell input swipe 500 2300 500 2300 2000\n    ```\n\n- To simulate a drag gesture from the middle of the screen to the top-right:\n    ```\n    adb shell input swipe 250 1150 500 0\n    ```\n\n- To simulate a drag gesture from the middle of the screen to the bottom-left:\n    ```\n    adb shell input swipe 250 1150 0 2300\n    ```\n\n- To tap on a point in the upper-middle section of the screen:\n    ```\n    adb shell input tap 250 600\n    ```\n\n- To tap on a point in the lower-middle section of the screen:\n    ```\n    adb shell input tap 250 1800\n    ```\n\n- To simulate a swipe diagonally from the top-left to the bottom-right of the screen:\n    ```\n    adb shell input swipe 0 0 500 2300\n    ```\n\n- To simulate a swipe diagonally from the top-right to the bottom-left of the screen:\n    ```\n    adb shell input swipe 500 0 0 2300\n    ```\n\n- To simulate a swipe diagonally from the bottom-left to the top-right of the screen:\n    ```\n    adb shell input swipe 0 2300 500 0\n    ```\n\n- To simulate a swipe diagonally from the bottom-right to the top-left of the screen:\n    ```\n    adb shell input swipe 500 2300 0 0\n    ```\n\n\n- To simulate a swipe from left to right across the screen (useful for going to the next item in a carousel):\n    ```\n    adb shell input swipe 0 1150 500 1150\n    ```\n\n- To simulate a swipe from right to left across the screen (useful for going to the previous item in a carousel):\n    ```\n    adb shell input swipe 500 1150 0 1150\n    ```\n\n- To simulate a tap on the \"Back\" button area (assuming it's at the bottom-left of the screen):\n    ```\n    adb shell input tap 50 2250\n    ```\n\n- To simulate a tap on the \"Home\" button area (assuming it's at the bottom-middle of the screen):\n    ```\n    adb shell input tap 250 2250\n    ```\n\n- To simulate a tap on the \"Recent Apps\" button area (assuming it's at the bottom-right of the screen):\n    ```\n    adb shell input tap 450 2250\n    ```\n\n- To simulate a swipe from the \"Recent Apps\" button to the middle of the screen (useful for opening the recent apps view):\n    ```\n    adb shell input swipe 450 2250 250 1150\n    ```\n\n- To simulate a swipe from the top to the middle of the screen (useful for pulling down the notification shade):\n    ```\n    adb shell input swipe 250 0 250 1150\n    ```\n\n- To simulate a swipe from the middle to the top of the screen (useful for pushing up the notification shade):\n    ```\n    adb shell input swipe 250 1150 250 0\n    ```\n\n- To simulate a long press on the \"Home\" button (useful for triggering Google Assistant or any other bound service):\n    ```\n    adb shell input swipe 250 2250 250 2250 2000\n    ```\n\n- To simulate a tap on the upper-middle-left of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 125 575\n    ```\n\n- To simulate a tap on the upper-middle-right of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 375 575\n    ```\n\n- To simulate a tap on the lower-middle-left of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 125 1725\n    ```\n\n- To simulate a tap on the lower-middle-right of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 375 1725\n    ```\n\n- To simulate a long press in the upper-middle-left of the screen:\n    ```\n    adb shell input swipe 125 575 125 575 2000\n    ```\n\n- To simulate a long press in the upper-middle-right of the screen:\n    ```\n    adb shell input swipe 375 575 375 575 2000\n    ```\n\n- To simulate a long press in the lower-middle-left of the screen:\n    ```\n    adb shell input swipe 125 1725 125 1725 2000\n    ```\n\n- To simulate a long press in the lower-middle-right of the screen:\n    ```\n    adb shell input swipe 375 1725 375 1725 2000\n    ```\n\n- To simulate a diagonal swipe from upper-middle-left to lower-middle-right of the screen:\n    ```\n    adb shell input swipe 125 575 375 1725\n    ```\n\n- To simulate a diagonal swipe from upper-middle-right to lower-middle-left of the screen:\n    ```\n    adb shell input swipe 375 575 125 1725\n    ```\n\n- To simulate a diagonal swipe from lower-middle-left to upper-middle-right of the screen:\n    ```\n    adb shell input swipe 125 1725 375 575\n    ```\n\n- To simulate a diagonal swipe from lower-middle-right to upper-middle-left of the screen:\n    ```\n    adb shell input swipe 375 1725 125 575\n    ```\n\n- To simulate a tap on the center of the status bar (useful for some quick settings):\n    ```\n    adb shell input tap 250 50\n    ```\n\n- To simulate a tap on the center of the antenna area (might be useful for some games or full-screen apps):\n    ```\n    adb shell input tap 250 2250\n    ```\n\n- To simulate a swipe from the center of the antenna area to the center of the screen (useful for some games or full-screen apps):\n    ```\n    adb shell input swipe 250 2250 250 1150\n    ```\n\n- To simulate a swipe from the center of the status bar to the center of the screen (useful for pulling down the notification shade):\n    ```\n    adb shell input swipe 250 50 250 1150\n    ```\n\n- To simulate a \"zig-zag\" swipe from the top-left to the bottom-right of the screen:\n    ```\n    adb shell input swipe 0 0 500 1150 \u0026 adb shell input swipe 500 1150 0 2300\n    ```\n\n- To simulate a \"zig-zag\" swipe from the top-right to the bottom-left of the screen:\n    ```\n    adb shell input swipe 500 0 0 1150 \u0026 adb shell input swipe 0 1150 500 2300\n    ```\n\n- To simulate a pinch gesture at the top of the screen:\n    ```\n    adb shell input swipe 125 300 250 600 \u0026 adb shell input swipe 375 300 250 600\n    ```\n\n- To simulate a spread gesture at the top of the screen:\n    ```\n    adb shell input swipe 250 600 125 300 \u0026 adb shell input swipe 250 600 375 300\n    ```\n\n- To simulate a pinch gesture at the bottom of the screen:\n    ```\n    adb shell input swipe 125 2000 250 1700 \u0026 adb shell input swipe 375 2000 250 1700\n    ```\n\n- To simulate a spread gesture at the bottom of the screen:\n    ```\n    adb shell input swipe 250 1700 125 2000 \u0026 adb shell input swipe 250 1700 375 2000\n    ```\n\n- To simulate a complex gesture (like drawing an \"X\" from corner to corner):\n    ```\n    adb shell input swipe 0 0 500 2300 \u0026 adb shell input swipe 500 0 0 2300\n    ```\n    \n- To simulate a swipe from left to right across the screen (useful for going to the next item in a carousel):\n    ```\n    adb shell input swipe 0 1150 500 1150\n    ```\n\n- To simulate a swipe from right to left across the screen (useful for going to the previous item in a carousel):\n    ```\n    adb shell input swipe 500 1150 0 1150\n    ```\n\n- To simulate a tap on the \"Back\" button area (assuming it's at the bottom-left of the screen):\n    ```\n    adb shell input tap 50 2250\n    ```\n\n- To simulate a tap on the \"Home\" button area (assuming it's at the bottom-middle of the screen):\n    ```\n    adb shell input tap 250 2250\n    ```\n\n- To simulate a tap on the \"Recent Apps\" button area (assuming it's at the bottom-right of the screen):\n    ```\n    adb shell input tap 450 2250\n    ```\n\n- To simulate a swipe from the \"Recent Apps\" button to the middle of the screen (useful for opening the recent apps view):\n    ```\n    adb shell input swipe 450 2250 250 1150\n    ```\n\n- To simulate a swipe from the top to the middle of the screen (useful for pulling down the notification shade):\n    ```\n    adb shell input swipe 250 0 250 1150\n    ```\n\n- To simulate a swipe from the middle to the top of the screen (useful for pushing up the notification shade):\n    ```\n    adb shell input swipe 250 1150 250 0\n    ```\n\n- To simulate a long press on the \"Home\" button (useful for triggering Google Assistant or any other bound service):\n    ```\n    adb shell input swipe 250 2250 250 2250 2000\n    ```\n\n- To simulate a tap on the upper-middle-left of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 125 575\n    ```\n\n- To simulate a tap on the upper-middle-right of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 375 575\n    ```\n\n- To simulate a tap on the lower-middle-left of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 125 1725\n    ```\n\n- To simulate a tap on the lower-middle-right of the screen (might be useful for some apps):\n    ```\n    adb shell input tap 375 1725\n    ```\n\n- To simulate a long press in the upper-middle-left of the screen:\n    ```\n    adb shell input swipe 125 575 125 575 2000\n    ```\n\n- To simulate a long press in the upper-middle-right of the screen:\n    ```\n    adb shell input swipe 375 575 375 575 2000\n    ```\n\n- To simulate a long press in the lower-middle-left of the screen:\n    ```\n    adb shell input swipe 125 1725 125 1725 2000\n    ```\n\n- To simulate a long press in the lower-middle-right of the screen:\n    ```\n    adb shell input swipe 375 1725 375 1725 2000\n    ```\n\n- To simulate a diagonal swipe from upper-middle-left to lower-middle-right of the screen:\n    ```\n    adb shell input swipe 125 575 375 1725\n    ```\n\n- To simulate a diagonal swipe from upper-middle-right to lower-middle-left of the screen:\n    ```\n    adb shell input swipe 375 575 125 1725\n    ```\n\n- To simulate a diagonal swipe from lower-middle-left to upper-middle-right of the screen:\n    ```\n    adb shell input swipe 125 1725 375 575\n    ```\n\n- To simulate a diagonal swipe from lower-middle-right to upper-middle-left of the screen:\n    ```\n    adb shell input swipe 375 1725 125 575\n    ```\n\n- To simulate a tap on the center of the status bar (useful for some quick settings):\n    ```\n    adb shell input tap 250 50\n    ```\n\n- To simulate a tap on the center of the antenna area (might be useful for some games or full-screen apps):\n    ```\n    adb shell input tap 250 2250\n    ```\n\n- To simulate a swipe from the center of the antenna area to the center of the screen (useful for some games or full-screen apps):\n    ```\n    adb shell input swipe 250 2250 250 1150\n    ```\n\n- To simulate a swipe from the center of the status bar to the center of the screen (useful for pulling down the notification shade):\n    ```\n    adb shell input swipe 250 50 250 1150\n    ```\n\n- To simulate a \"zig-zag\" swipe from the top-left to the bottom-right of the screen:\n    ```\n    adb shell input swipe 0 0 500 1150 \u0026 adb shell input swipe 500 1150 0 2300\n    ```\n\n- To simulate a \"zig-zag\" swipe from the top-right to the bottom-left of the screen:\n    ```\n    adb shell input swipe 500 0 0 1150 \u0026 adb shell input swipe 0 1150 500 2300\n    ```\n\n- To simulate a pinch gesture at the top of the screen:\n    ```\n    adb shell input swipe 125 300 250 600 \u0026 adb shell input swipe 375 300 250 600\n    ```\n\n- To simulate a spread gesture at the top of the screen:\n    ```\n    adb shell input swipe 250 600 125 300 \u0026 adb shell input swipe 250 600 375 300\n    ```\n\n- To simulate a pinch gesture at the bottom of the screen:\n    ```\n    adb shell input swipe 125 2000 250 1700 \u0026 adb shell input swipe 375 2000 250 1700\n    ```\n\n- To simulate a spread gesture at the bottom of the screen:\n    ```\n    adb shell input swipe 250 1700 125 2000 \u0026 adb shell input swipe 250 1700 375 2000\n    ```\n\n- To simulate a complex gesture (like drawing an \"X\" from corner to corner):\n    ```\n    adb shell input swipe 0 0 500 2300 \u0026 adb shell input swipe 500 0 0 2300\n    ```\n\nAbsolutely, here are more examples for screen interactions on an Android device:\n\n- To simulate a long press in the middle and then a swipe to the right (useful for triggering slide menus):\n    ```\n    adb shell input swipe 250 1150 400 1150 2000\n    ```\n\n- To simulate a long press in the middle and then a swipe to the left (useful for triggering slide menus):\n    ```\n    adb shell input swipe 250 1150 100 1150 2000\n    ```\n\n- To simulate a swipe from the center of the screen to the \"Back\" button (might be useful for some full-screen apps):\n    ```\n    adb shell input swipe 250 1150 50 2250\n    ```\n\n- To simulate a swipe from the center of the screen to the \"Home\" button (might be useful for some full-screen apps):\n    ```\n    adb shell input swipe 250 1150 250 2250\n    ```\n\n- To simulate a swipe from the center of the screen to the \"Recent Apps\" button (might be useful for some full-screen apps):\n    ```\n    adb shell input swipe 250 1150 450 2250\n    ```\n\n- To simulate a long press on the top-middle of the screen (might be useful for some apps):\n    ```\n    adb shell input swipe 250 300 250 300 2000\n    ```\n\n- To simulate a long press on the bottom-middle of the screen (might be useful for some apps):\n    ```\n    adb shell input swipe 250 2000 250 2000 2000\n    ```\n\n- To simulate a pinch gesture in the left-half of the screen:\n    ```\n    adb shell input swipe 0 1150 125 1150 \u0026 adb shell input swipe 250 1150 125 1150\n    ```\n\n- To simulate a spread gesture in the left-half of the screen:\n    ```\n    adb shell input swipe 125 1150 0 1150 \u0026 adb shell input swipe 125 1150 250 1150\n    ```\n\n- To simulate a pinch gesture in the right-half of the screen:\n    ```\n    adb shell input swipe 500 1150 375 1150 \u0026 adb shell input swipe 250 1150 375 1150\n    ```\n\n- To simulate a spread gesture in the right-half of the screen:\n    ```\n    adb shell input swipe 375 1150 500 1150 \u0026 adb shell input swipe 375 1150 250 1150\n    ```\n\n- To simulate a swipe in the shape of a square (might be useful for some games or apps):\n    ```\n    adb shell input swipe 125 875 375 875 \u0026 adb shell input swipe 375 875 375 1425 \u0026 adb shell input swipe 375 1425 125 1425 \u0026 adb shell input swipe 125 1425 125 875\n    ```\n\n- To simulate a swipe in the shape of a circle (might be useful for some games or apps):\n    ```\n    # This is a bit complex and might not be perfect, but it's a way to simulate a circular swipe:\n    adb shell input swipe 250 1150 375 1150 500 \u0026 adb shell input swipe 375 1150 375 1425 500 \u0026 adb shell input swipe 375 1425 125 1425 500 \u0026 adb shell input swipe 125 1425 125 875 500 \u0026 adb shell input swipe 125 875 250 875 500\n    ```\n\n- To simulate a tap on the center of the screen with a delay (useful for timed inputs):\n    ```\n    adb shell input tap 250 1150; sleep 1\n    ```\n\n- To simulate multiple taps on the center of the screen with a delay between each (useful for timed inputs):\n    ```\n    adb shell input tap 250 1150; sleep 1; adb shell input tap 250 1150; sleep 1; adb shell input tap 250 1150\n    ```\n\n- To simulate a swipe from the middle to the left of the screen (useful for some slide menus):\n    ```\n    adb shell input swipe 250 1150 0 1150\n    ```\n\n- To simulate a swipe from the middle to the right of the screen (useful for some slide menus):\n    ```\n    adb shell input swipe 250 1150 500 1150\n    ```\n\n- To simulate a swipe from the left to the middle of the screen (useful for some slide menus):\n    ```\n    adb shell input swipe 0 1150 250 1150\n    ```\n\n- To simulate a swipe from the right to the middle of the screen (useful for some slide menus):\n    ```\n    adb shell input swipe 500 1150 250 1150\n    ```\n\n- To simulate a swipe from the \"Back\" button to the \"Home\" button (useful for some full-screen apps):\n    ```\n    adb shell input swipe 50 2250 250 2250\n    ```\n\n- To simulate a swipe from the \"Home\" button to the \"Recent Apps\" button (useful for some full-screen apps):\n    ```\n    adb shell input swipe 250 2250 450 2250\n    ```\n\n- To simulate a swipe from the \"Recent Apps\" button to the \"Home\" button (useful for some full-screen apps):\n    ```\n    adb shell input swipe 450 2250 250 2250\n    ```\n\n- To simulate a swipe from the \"Home\" button to the \"Back\" button (useful for some full-screen apps):\n    ```\n    adb shell input swipe 250 2250 50 2250\n    ```\n\n- To simulate a long press on the \"Recent Apps\" button (useful for some services):\n    ```\n    adb shell input swipe 450 2250 450 2250 2000\n    ```\n\nSimulate input events using the `input` command.\n\n### Erase all text\n\n```bash\nadb shell input keyevent KEYCODE_MOVE_END\nadb shell input keyevent |    --longpress $(printf 'KEYCODE_DEL %.0s' {1..250})\n```\n\nStart Calculator via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALCULATOR\n```\n\nStart Calendar via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALENDAR\n```\n\nStart Call Application via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALL\n```\n\nStart Camera via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAMERA\n```\n\nPress Caps Lock via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAPS_LOCK\n```\n\nStart Captions via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAPTIONS\n```\n\nOpen Contacts Application via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CONTACTS\n```\n\nCopy via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_COPY\n```\n\nCut via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CUT\n```\n\nDelete via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_DEL\n```\n\nEndCall via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_ENDCALL\n```\n\nPress END via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_END\n```\n\nJump to the beginning of the line\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_UP\n```\n\nJump to the end of the line\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_DOWN\n```\n\nMove the cursor one step to the left/right\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_LEFT\nadb shell input keyevent KEYCODE_DPAD_RIGHT\n\n\n```\n\nPress Home Button\n\n```bash\nadb shell input keyevent KEYCODE_HOME\n```\n\nPress + and - buttons\n\n```bash\nadb shell input keyevent KEYCODE_MINUS\nadb shell input keyevent KEYCODE_PLUS\n```\n\nPress + in the numpad\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_ADD\n```\n\nPress * button\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_MULTIPLY\n```\n\nPress search key\n\n```bash\nadb shell input keyevent KEYCODE_SEARCH\n```\n\nOpen Settings\n\n```bash\nadb shell input keyevent KEYCODE_SETTINGS\n```\n\nPress # button\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_MULTIPLY\n```\n\nStart default music app\n\n```bash\nadb shell input keyevent KEYCODE_POUND\n```\n\nMute Volume\n\n```bash\nadb shell input keyevent KEYCODE_MUTE\n```\n\nOpen the notification bar and close\n\n```bash\nadb shell input keyevent KEYCODE_NOTIFICATION\nadb shell input keyevent KEYCODE_NOTIFICATION\n```\n\nCancel long press\n\n```bash\nadb shell input keyevent FLAG_CANCELED_LONG_PRESS\n```\n\nOpen App Switch for changing applications\n\n```bash\nadb shell input keyevent KEYCODE_APP_SWITCH\n```\n\nOpen Default Assistant\n\n```bash\nadb shell input keyevent KEYCODE_BRIGHTNESS_DOWN\nadb shell input keyevent KEYCODE_BRIGHTNESS_UP\n```\n\nSelect\n\n```bash\nadb shell input keyevent KEYCODE_BUTTON_SELECT\n```\n\nSwipe from top to bottom\n\n```bash\nadb shell input swipe 0 0 0 1000\n```\n\nSwipe from bottom to top\n\n```bash\nadb shell input swipe 0 1000 0 0\nadb shell input swipe 100 4000 200 400\n```\n\nSwipe slower from bottom to top\n\n```bash\nadb shell input swipe 500 1000 0 0\n```\n\nPinch out slowly\n\n```bash\nadb shell input swipe 100 100 20 20\n```\n\nPinch out harder\n\n```bash\nadb shell input swipe 100 100 20 1000\n```\n\nSwipe your finger up and move window down\n\n```bash\nadb shell input swipe 100 1000 20 100\n```\n\nSimulate a swipe down for notification bar\n\n```bash\nadb shell input swipe 0 0 0 300 \n```\n\nSwipe and unlock the screen\n\n```bash\nadb shell input swipe 300 1000 300 500 \n```\n\n### Erase all text\n\n```bash\nadb shell input keyevent KEYCODE_MOVE_END\nadb shell input keyevent |    --longpress $(printf 'KEYCODE_DEL %.0s' {1..250})\n```\n\nStart Calculator via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALCULATOR\n```\n\nStart Calendar via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALENDAR\n```\n\nStart Call Application via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CALL\n```\n\nStart Camera via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAMERA\n```\n\nPress Caps Lock via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAPS_LOCK\n```\n\nStart Captions via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CAPTIONS\n```\n\nOpen Contacts Application via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CONTACTS\n```\n\nCopy via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_COPY\n```\n\nCut via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_CUT\n```\n\nDelete via Key\n\nevent\n\n```bash\nadb shell input keyevent KEYCODE_DEL\n```\n\nEndCall via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_ENDCALL\n```\n\nPress END via Keyevent\n\n```bash\nadb shell input keyevent KEYCODE_END\n```\n\nJump to the beginning of the line\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_UP\n```\n\nJump to the end of the line\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_DOWN\n```\n\nMove the cursor one step to the left/right\n\n```bash\nadb shell input keyevent KEYCODE_DPAD_LEFT\nadb shell input keyevent KEYCODE_DPAD_RIGHT\n```\n\nPress the Grave (`) key\n\n```bash\nadb shell input keyevent KEYCODE_GRAVE\n```\n\nPress Home Button\n\n```bash\nadb shell input keyevent KEYCODE_HOME\n```\n\nPress + and - buttons\n\n```bash\nadb shell input keyevent KEYCODE_MINUS\nadb shell input keyevent KEYCODE_PLUS\n```\n\nPress + in the numpad\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_ADD\n```\n\nPress * button\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_MULTIPLY\n```\n\nPress search key\n\n```bash\nadb shell input keyevent KEYCODE_SEARCH\n```\n\nOpen Settings\n\n```bash\nadb shell input keyevent KEYCODE_SETTINGS\n```\n\nPress # button\n\n```bash\nadb shell input keyevent KEYCODE_NUMPAD_MULTIPLY\n```\n\nStart default music app\n\n```bash\nadb shell input keyevent KEYCODE_POUND\n```\n\nMute Volume\n\n```bash\nadb shell input keyevent KEYCODE_MUTE\n```\n\nOpen the notification bar and close\n\n```bash\nadb shell input keyevent KEYCODE_NOTIFICATION\nadb shell input keyevent KEYCODE_NOTIFICATION\n```\n\nCancel long press\n\n```bash\nadb shell input keyevent FLAG_CANCELED_LONG_PRESS\n```\n\nOpen App Switch for changing applications\n\n```bash\nadb shell input keyevent KEYCODE_APP_SWITCH\n```\n\nOpen Default Assistant\n\n```bash\nadb shell input keyevent KEYCODE_BRIGHTNESS_DOWN\nadb shell input keyevent KEYCODE_BRIGHTNESS_UP\n```\n\nSelect\n\n```bash\nadb shell input keyevent KEYCODE_BUTTON_SELECT\n```\n\n### Add a Contact, fill info, and press save on the device\n\n```bash\nadb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'wuseman' -e phone '+467777701' -e email 'wuseman@nr1.nu' -e postal 'Street 10, New York'\n```\n\nPress save contact via shell from the above command\n\n```bash\nadb shell input keyevent 4\nadb shell input keyevent 4 \n```\n\n```bash\nadb shell am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'wuseman' -e phone '+46728999329' -e email 'wuseman@nr1.nu' \n```\n\n## keytool\n\nKeytool is a command-line tool for managing keys and certificates.\n\n### Generate hash from keystore (typically used in Facebook)\n\n```bash\nkeytool -exportcert -alias your_alias -keystore debug.keystore | openssl sha1 -binary | openssl base64 \n```\n\nTypically used in Google Maps\n\n```bash\nkeytool -list -v -keystore ~/.android/debug.keystore -alias your_alias           \n```\n\n## logcat\n\nUse the `logcat` command to view logs generated by the system and applications.\n\n| Tag | Description |\n|-----|------------|\n| V   | Verbose (lowest\n\n priority)  |\n| D   | Debug                      |\n| I   | Info (default priority)    |\n| W   | Warning                    |\n| E   | Error                      |\n| F   | Fatal                      |\n| S   | Silent (highest priority, on which nothing is ever printed) |\n\nPrint the most recent lines since the specified time\n\n```bash\nadb logcat -t '01-26 20:52:41.820'\n```\n\nPrint log only from a specific process ID\n\n```bash\nadb logcat --pid=\u003cpid\u003e\n```\n\nLog multiple options\n\n```bash\nadb logcat -b main -b radio -b events\n```\n\nRun all options at once\n\n```bash\nadb logcat -v brief \\\n    -v long \\\n    -v process \\\n    -v raw \\\n    -v tag \\\n    -v thread \\\n    -v threadtime \\\n    -v time \\\n    -v color\n```\n\nPrint log from `lock_settings` only\n\n```bash\nadb logcat | grep \"LockSettingsService|LockPatternUtilsKeyStorage|vold|vold|keystore2|keymaster_tee|LockSettingsService|vold_prepare_subdirs\"\n```\n\n## pm\n\nThe `pm` command is used to manage packages on the device.\n\nDisable AutoUpdate for any Package\n\n```bash\nadb shell pm disable-user --user 0 \u003cpackage_name\u003e\n```\n\nDisable AutoUpdate for all applications\n\n```bash\nadb shell pm disable-user com.android.vending\n```\n\nPrint all applications in use\n\n```bash\nadb shell pm list packages | sed -e \"s/package://\" | while read x; do cmd package resolve-activity --brief $x | tail -n 1 | grep -v \"No activity found\"; done\n```\n\nList all packages installed on the device\n\n```bash\nadb shell pm list packages\n```\n\nList enabled packages\n\n```bash\nadb shell pm list packages -e\n```\n\nList disabled packages\n\n```bash\nadb shell pm list packages -d\n```\n\nList third-party packages installed by the user\n\n```bash\nadb shell pm list packages -3\n```\n\nList users\n\n```bash\nadb shell pm list users\n```\n### List permission groups\n\n```bash\nadb shell pm list permission-groups\n```\n\n### List features\n\n```bash\nadb shell pm list features\n```\n\n### Uninstall any installed package\n\n```bash\nadb shell pm uninstall --user 0 com.package.name\n```\n\n### Uninstall multiple apps\n\n```sh\nfor packages in com.package1 com.package2; do\n    adb shell pm uninstall --user 0 \"${packages}\"\ndone\n```\n\n### Clear application data\n\n```bash\nadb shell pm clear PACKAGE_NAME\n```\n\n### Grant permission to an app\n\n```bash\nadb shell pm grant com.application android.permission.READ_LOGS\n```\n\n### Revoke permission from an app\n\n```bash\nadb shell pm revoke com.application android.permission.READ_LOGS\n```\n\n### Reset all permissions for an app\n\n```bash\nadb shell pm reset-permissions -p your.app.package\n```\n\n## reboot\n\n### Reboot system\n\n```sh\nadb reboot\n```\n\n### Reboot to recovery\n\n```bash\nadb reboot recovery\n```\n\n### Reboot to bootloader\n\n```bash\nadb reboot bootloader\n```\n\n### Reboot to fastboot (some brands)\n\n```bash\nadb reboot fastboot\n```\n\n## Android Shell Resources\n\n- [Dirty Pagetable: A Novel Exploitation Technique To Rule Linux Kernel](https://yanglingxi1993.github.io/dirty_pagetable/dirty_pagetable.html)\n- [Android™ Developer - Emulator Console](https://developer.android.com/studio/run/emulator-console)\n- [Android™ Developer - Write your app](https://developer.android.com/studio/write)\n- [Android™ Google Source - Source Code](https://android.googlesource.com/)\n- [Android™ Google Source - CMD Command](https://android.googlesource.com/platform/frameworks/native/+/master/cmds/cmd/)\n- [Android™ Generic Project](https://android-generic.github.io/#documentation)\n- [Android™ GDB](https://source.android.com/devices/tech/debug/gdb)\n- [Android™ Source - Understand Logging](https://source.android.com/devices/tech/debug/understanding-logging)\n- [Android™ Source - Network Connectivity Tests](https://source.android.com/devices/tech/connect/connect_tests)\n- [Android™ Platform Tools](https://android.googlesource.com/platform/prebuilts/cmdline-tools/+/34a182b3646de1051ea2c9b23132d073bcaa5087/tools/bin/)\n- [Github Randorise - Mobile Hacking CheatSheet](https://github.com/randorisec/MobileHackingCheatSheet)\n- [Mazhuang - Awesome ADB - Another Cheatsheet Wiki](https://mazhuang.org/awesome-adb/README.en.html)\n- [Jfsso - Preferences Editor](https://github.com/jfsso/PreferencesEditor)\n- [Nahamsec - Resources For Beginner - Bug Bounty Hunters](https://github.com/nahamsec/Resources-for-Beginner-Bug-Bounty-Hunters/blob/master/assets/mobile.md)\n- [Raywenderlich - Forensic Artifacts](https://www.raywenderlich.com/3419415-hack-an-android-app-finding-forensic-artifacts#toc-anchor-002)\n- [Noobsec - Bypass Fingerprint Lock In Just 1 Second](https://noobsec.org/project/2019-12-22-bypass-fingerprint-lock-in-just-1-second/)\n- [Noobsec - Cara Reverse Engineering](https://noobsec.org/project/2018-11-04-cara-reverse-engineering-apk/)\n- [Oracle - JVMS](https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html)\n- [Tjtech - Analyze OEM Unlocking Under Android](http://tjtech.me/analyze-oem-unlocking-under-android.html)\n- [U'Smile - How to change the IMEI on Android devices](https://usmile.at/blog/how-to-change-imei-on-android-devices)\n- [Android™ Q Navigation - Gesture Controls](https://www.xda-developers.com/android-q-navigation-gesture-controls/#fitvid892986)\n- [Good review for clipboard control](https://www.smartspate.com/how-to-copy-text-from-the-clipboard-to-android-devices/)\n- [Utilizing adb for daily tasks](https://www.droidcon.com/2021/10/21/utilizing-adb-for-daily-tasks/)\n\n\n## Greetings\n\nGreetings to all my esteemed colleagues who have placed their trust in me and granted me the opportunity to explore various devices. Your unwavering support is deeply appreciated, and I hold great affection for each one of you.\n\n\u003cbr\u003e\n\u003cp align=\"center\"\u003eLearn with ❤️ By \u003ca href=\"https://www.youtube.com/channel/UC2O1Hfg-dDCbUcau5QWGcgg\"\u003eLinuxndroid\u003c/a\u003e\u003c/p\u003e\n\n\n# Follow Me on :\n\n[![Instagram](https://img.shields.io/badge/IG-linuxndroid-yellowgreen?style=for-the-badge\u0026logo=instagram)](https://www.instagram.com/linuxndroid)\n\n[![Youtube](https://img.shields.io/badge/Youtube-linuxndroid-redgreen?style=for-the-badge\u0026logo=youtube)](https://www.youtube.com/channel/UC2O1Hfg-dDCbUcau5QWGcgg)\n\n[![Browser](https://img.shields.io/badge/Website-linuxndroid-yellowred?style=for-the-badge\u0026logo=browser)](https://www.linuxndroid.com)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxndroid%2Fadb-cheat-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxndroid%2Fadb-cheat-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxndroid%2Fadb-cheat-sheet/lists"}