{"id":13994711,"url":"https://github.com/matan-h/adb-shell","last_synced_at":"2025-06-24T06:11:37.000Z","repository":{"id":233281577,"uuid":"786396339","full_name":"matan-h/adb-shell","owner":"matan-h","description":"better `adb shell` ","archived":false,"fork":false,"pushed_at":"2024-04-15T13:07:55.000Z","size":53,"stargazers_count":189,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-29T16:39:26.209Z","etag":null,"topics":["adb","adb-shell","android","better","command-line","config","mksh","mkshrc","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matan-h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-04-14T10:36:13.000Z","updated_at":"2024-11-01T03:06:48.000Z","dependencies_parsed_at":"2024-04-19T12:15:01.901Z","dependency_job_id":"4b5c1022-ae25-41d8-93c8-180f63392bb0","html_url":"https://github.com/matan-h/adb-shell","commit_stats":null,"previous_names":["matan-h/adb-shell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matan-h/adb-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matan-h%2Fadb-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matan-h%2Fadb-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matan-h%2Fadb-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matan-h%2Fadb-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matan-h","download_url":"https://codeload.github.com/matan-h/adb-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matan-h%2Fadb-shell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261618139,"owners_count":23185098,"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","adb-shell","android","better","command-line","config","mksh","mkshrc","shell"],"created_at":"2024-08-09T14:03:03.915Z","updated_at":"2025-06-24T06:11:36.971Z","avatar_url":"https://github.com/matan-h.png","language":"Shell","funding_links":["https://www.buymeacoffee.com/matanh"],"categories":["Shell"],"sub_categories":[],"readme":"# Better `adb shell`.\nThis repo uses the options of [mksh](https://manpages.ubuntu.com/manpages/xenial/man1/mksh.1.html) (the android default shell) to get a better shell.\n\n## Features\n\n### General\n* Colored prompt with path and color difference between successes and fail statuses:\n\n![screenshot-of-prompt](screenshots/prompt.png)\n\n* Keyboard shortcuts, such as `ctrl+l` to clear the screen (in normal `adb shell` it's a shortcut for 'enter' for some reason).\n* `CDPATH`: you can `cd` to any directory in `/sdcard`, `Android/data` or `/` without typing the full path \n(for example `cd com.android.chrome` even when you are in `/` directory)\n\n### ls aliases\n* `ls` with color by default.\n* shortcuts like `ll` and `la`. \n* one alias to fix the typo `sl` =\u003e `ls`.\n\n### More aliases\n* basic commands: `rd` (`rmdir`) and `md` (`mkdir`).\n* `cls`(clear the screen)\n* `rmtree` (remove folder)\n* `..` and `cd..` =\u003e `cd ..`\n* `untar` (=\u003e `tar xvf`)\n\n## Installation\nclone this repo:\n```bash\ngit clone https://github.com/matan-h/adb-shell\n```\n### Linux/macOS\n`chmod +x` and run the `adb-shell.sh` file\n(it's a short file, highly recommend you go and read [it](https://github.com/matan-h/adb-shell/blob/main/adb-shell.sh) [and possibly also the `startup.sh` file] before executing)\n```bash\nchmod +x adb-shell.sh\n./adb-shell.sh\n```\nThis will create the startup file for the `mksh` shell if it doesn't exist, and start the better `adb shell`.\n\nTo make this `adb-shell` globally accessible ether add this to your `$PATH` or add an `alias` to this file:\n```bash \n# add this to your .rc file\nalias adb-shell=\"\u003cPATH TO THIS REPO\u003e/adb-shell.sh\"\n```\n### Windows\nRun the `adb-shell.ps1` script (it's a short file, highly recommend you go and read [it](https://github.com/matan-h/adb-shell/blob/main/adb-shell.ps1) [and possibly also the `startup.sh` file] before executing)\n```powershell\npowershell -executionpolicy bypass -File .\\adb-shell.ps1\n```\nTo make this `adb-shell` globally accessible ether add this to your `$PATH` or add an `alias` to this file:\n\n```powershell\n# add this to your powershell $PROFILE file (most likely $HOME\\Documents\\PowerShell\\Microsoft.PowerShell_profile.ps1)\nset-alias \"adb-shell\" \"\u003cPATH TO THIS REPO\u003e\\adb-shell.ps1\"\n```\n\u003c!-- TODO: There are better ways to deliver PS1 scripts than alias, since this requires setting the execution policy. --\u003e\n\n## History experimental feature\n[history is disabled by default in the android shell build options](https://android.stackexchange.com/a/152093). \n\nHowever, It's possible to emulate that using the shell functions (e.g. write the last command to a history file after every command.)\nThe history is currently in testing state. If you want to enable it, go to `startup.sh` and change `ENABLE_EXPERIMENTAL_HISTORY` to `true`. (then `adb push startup.sh /sdcard/.adb/startup.sh`) Please open a GitHub issue for any bug/problem/suggestion.\n\n## Advanced Installation\n\nThe `adb-shell.sh/.ps1` just pushes `startup.sh` and starts `adb shell` with the config file.\nThat means, you can skip this automated script, and configure it manually, using:\n```shell\nSTARTUP=/sdcard/.adb/startup.sh\nalias adb-shell=\"adb shell -t \\\"HOME='/sdcard' ENV='$STARTUP' sh -i\\\"\"\n```\nThe `startup.sh` is actually `.mksh` file for android, so if you want to [config](http://www.mirbsd.org/mksh-faq.htm) [it](https://github.com/MirBSD/mksh/blob/master/dot.mkshrc) [manually](http://www.mirbsd.org/htman/i386/man1/mksh.htm), you can.\n\nWhen you want to apply changes, run the following command:\n`adb push startup.sh $STARTUP`\n\n# Contribute\nOn all errors, problems or suggestions please open a [GitHub issue](https://github.com/matan-h/adb-shell/issues)\n\nIf you found this script useful, it would be great if you could buy me a coffee:\n\n\u003ca href=\"https://www.buymeacoffee.com/matanh\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-blue.png\" alt=\"Buy Me A Coffee\" height=\"47\" width=\"200\"\u003e\u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatan-h%2Fadb-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatan-h%2Fadb-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatan-h%2Fadb-shell/lists"}