The shell is a piece of software that provides an command-line interface to the operating system. Use this tag for shell-specific issues; general command-line issues should use the 'command-line' tag instead. See full tag wiki for other related tags.

learn more… | top users | synonyms

21
votes
3answers
69k views

Where in the file system are applications installed?

I have installed a few Android applications both with the adb install MyApplication.apk command and via a webserver (like an alternative to Android Market). But where in the Android file system on my ...
18
votes
4answers
1k views

How can I use shell commands and interact with the Linux system underneath?

Android is based on Linux and has a Linux kernel underneath. Is there any way I can use shell commands and interact directly with the Linux system? E.g. A shell app that has access to the Linux ...
17
votes
2answers
37k views

How can I run a script on boot?

I'm accustomed to running scripts on boot in Linux, but I'm not sure how to do this in Android. I'd like to start my SSH daemon on start, so I'll always be able to connect. How can I run an arbitrary ...
13
votes
2answers
11k views

What useful Android Shell commands do you know? [closed]

There are questions pertaining to the use of the Android Shell or to finding a documentation of the Shell commands on Android. Since I haven't found anything convenient, I would like to use this ...
11
votes
1answer
3k views

Start an Android application via a shell script?

Is it possible to start an actual Android application from the command line in Android? For example, say I'd simply like to start/bring to the front my calendar. Is there a way that I can do this ...
9
votes
4answers
19k views

How can I flush the DNS Cache?

How can I clear my DNS cache on my android phone? (Droid3, Gingerbread, rooted to be specific) Ideally I'm looking for a command to run through a terminal emulator, something similar to ipconfig ...
9
votes
1answer
2k views

Toggling USB mass storage on (or off) via adb commands

Background: I have a USB stick Android device (e.g. RikoMagic) which I mostly run in "headless" mode. Among other things, I've already figured out how to shut it down via a combination of adb and the ...
8
votes
1answer
3k views

Rooted phone - sending SMS message via command line

I have a rooted Droid (Sholes), with ConnectBot installed. I can ssh into it via dropbear copied to /system/xbin, and/or also the instance of Debian installed on it via the "Linux Installer" ...
8
votes
1answer
2k views

How is the default PATH set?

On another linux system I might expect to find a .profile file, or something in /etc used by default. I'm unable to determine what sets the system path for processes not running in a shell.
8
votes
4answers
5k views

Running applications from a terminal emulator

I have a rooted Nexus 7 Jelly Bean tablet and whenever I attempt to run an application from a terminal emulator app after chmod 777ing it and using the syntax ("./applicationName") it insists that I ...
7
votes
6answers
3k views

How to prevent adb shell from exiting upon Ctrl+C

When I adb shell into my device (from Windows desktop), and run some command there, sometimes I want to terminate that command. The standard unixy way to do it is with Ctrl+C key combination. However, ...
7
votes
5answers
9k views

Where can I find documentation for shell commands?

For using a shell commands through a terminal program, where can I find documentation or help or man pages for the commands as implemented in Android? While it would be nice to have them on the ...
7
votes
2answers
3k views

Can I change some Android settings from the command line?

I would like to activate "USB tethering" from within a bash script, so is there any possibility to run a command line with adb shell to change some Android settings ? Edit1: The following command ...
6
votes
1answer
639 views

Why do linux commands not work properly on android?

> adb shell sh-4.1$ ls -F -F: No such file or directory -F switch works fine on my Ubuntu. Why doesn't it work on android? Is there a way to make it work?
6
votes
1answer
1k views

Is there a way to list the local dns cache?

I would like to get a list of my current cache on my phone, what is the command to issue in order to retrieve that list ? I would like to get a command and not an app that does that, since i want to ...
5
votes
2answers
6k views

adb “Permission denied” to run a “./configure” file

I need to run a configure file into my android phone so I think the best way to do this is to use the adb shell command. I'm running an Android emulator onto a Windows-7 platform, and there I'm ...
5
votes
2answers
2k views

Read APK permission by shell command

I want to read the requested permissions of an .apk file on the computer (android sdk is installed) via command line. I.E.: $ android read-permissions /path/to/someapp.apk I know this is possible, ...
5
votes
1answer
5k views

What's the best way to restart Android via command line (remotely)?

I'm looking for the best / friendliest way to reboot my rooted android 4.1.1 device. I found these solutions so far: su -c "reboot" - Causes problems with wifi after restart on my device... I read ...
5
votes
1answer
394 views

Getting total CPU time of a process

I need to get the total cpu time of a process in android. I am trying to use adb shell top commands, but it gives only cpu usage in terms of percentage. But I need the total cpu time of the process. ...
4
votes
2answers
3k views

How do I check if I have Cyanogenmod on my phone?

Is it possible to check using shell whether or not Cyanogenmod is installed on a device? In other words, something like uname -a (which tells the system Linux version and architecture). Can the ...
4
votes
2answers
2k views

Can I connect to a shell from a PC to my Android using bluetooth or USB?

I want to run some commands on my rooted android phone. It is not very practical to interact with a shell using the touch screen, therefore I wanted to run a daemon on it and connect to it from a PC. ...
4
votes
1answer
1k views

Is it possible to set device's Latitude and Longitude using ADB SHELL?

I know how to set locatlon for emulators using device configuration interface from Motodoev Studio for example. But, how I can set locatlon for a device?
4
votes
3answers
3k views

Broken Screen + Using adb shell to run vnc server

I have an HTC HD2 with a completely busted screen, I tried repairing it with a replacement screen but broke the ribbon cable to the screen (oops) sad day, I've got two of these and I've been running ...
4
votes
1answer
1k views

how to turn on/off automatic date/time settings

I would like to be able to turn the automatic date time settings on and off from tasker. I don't see a way to do this directly but I can use tasker to issue a shell command. I know I can just use ...
3
votes
2answers
4k views

Can i mount loopdevice in Android?

I have rooted my android phone and get a shell thr adb. I wanna mount a ROM image in android. But I always fail: mount -o loop /sdcard/myimage.img /mnt mount: can't setup loop device: No such file or ...
3
votes
2answers
2k views

How to mount a ext2 partition in sdcard

I don't want to use fat32, I want use the more stable ext2.
3
votes
2answers
8k views

Documentation for adb shell getevent / sendevent

Is there any documentation on the format of the getevent and sendevent shell commands? specifically the ones for touchevents. or is this device-dependent? it is a bit hard to guess what those ids are ...
3
votes
1answer
2k views

How to access a linux shell from my phone via bluetooth?

Basically I want to send shell commands from my phone to my PC (Ubuntu 11.10) via bluetooth. Why? Because I don't always have WLAN and WLAN on my phone sucks. All possible solutions are welcome. I ...
3
votes
3answers
1k views

Shell script to kill custom apps, run another app then restart killed apps?

Is it possible to make a shell script that would run using Smanager, for example, to do the following: Kill a list of custom apps loaded from a file Run one custom app loaded from the same file When ...
3
votes
1answer
783 views

I want to execute shell commands on my pc from my android via USB

I have a linux box, without any network interface, only usb. I have my andorid phone, and the USB cable. I would like to connect from my android device to the linux box,and execute shell commands on ...
3
votes
0answers
272 views

ADB Shell command that can test MLS / SPC codes? [closed]

I am a Republic Wireless subscriber with the Motorola Defy XT. The Defy is a decent phone, but unfortunately very little space has been dedicated to internal application storage (300MB) and often we ...
2
votes
1answer
15k views

Why can't I get root access from shell?

> adb shell sh-4.1$ su Permission denied I have rooted my phone successfully. I know this because I'm able to install apps on SD card and I have a program called SD Maid that is able to operate ...
2
votes
1answer
305 views

Disable browser prompt when using ADB to open an URL

I'm trying to open an URL using the ADB command: ./adb shell am start -a android.intent.action.VIEW -d URL When I have multiple browser support applications, I'm trying to open this using google ...
2
votes
2answers
753 views

copy folder structure from internal memory to sd-card

I use the amazon downloader to buy mp3s with my android device. My problem now is that I cannot change the download folder but want the files to be moved to my sdcard. I already found a cron tool to ...
2
votes
2answers
5k views

How to delete the history and cache in Opera Mobile (10.1) via shell?

I run Opera Mobile 10.1 on Android. My device is rooted. How can I clear the history and cache of the browser via shell? As su, removing ...
2
votes
3answers
2k views

How can I zip a folder into a zip file in Android to send over the Internet?

I have root, and I tried running the zip command from shell, but zip is not found. I think Android doesn't come with zip. How can I install zip on Android?
2
votes
1answer
367 views

`adb shell ime list` commands - Please clarify!

What do the following two commands mean adb shell ime list -s adb shell ime list and why don't the return anything at all? See code below: aneesh@nb-14:~$ adb shell ime list -s aneesh@nb-14:~$ adb ...
2
votes
2answers
1k views

Can't connect to the device with ADB when it's in recovery mode

I am having some problems with my Samsung Galaxy S2 and I want to start an fschk session on the device. So, I installed Android SDK with platform-tools. I can access to the device when it's normally ...
2
votes
0answers
220 views

How can I troubleshoot MTP on my Galaxy Nexus

My Galaxy Nexus 4.2.2 won't show up as a MTP device anymore. It looks like the phone is the problem, I want to debug the problem from that end. Like many before me, I tried everything, and then some ...
2
votes
0answers
1k views

Is it possible to enable Location Services via Shell?

Is it possible to enable Location Services(GPS or Google NetworkLocation) via ADB or Terminal Emulator? I'm on a rooted Phone. Extra Points: Is it also possible to change other system-related ...
2
votes
0answers
753 views

Remount writable by all users?

I want to remount a read-only partition in read-write mode, but I want it to be writable for all users. So far I've got this: mount -o bind /someplace /someplace_else mount -o remount rw ...
1
vote
2answers
434 views

How to install bundles of additional terminal commands for rooted devices?

I rooted a HTC Wildfire S device recently and flashed an Android 4.1.2 AOKP Jelly Bean Custom ROM. One benefit is that I can use the terminal now. I'm a little used to using terminal emulators on ...
1
vote
2answers
930 views

What is the applypatch tool and how does one use it?

I recently stumbled upon the applypatch tool, but I couldn't find any documentation for it online. Here is the usage output (this is after typing adb shell) shell@android:/ $ applypatch --help ...
1
vote
1answer
68 views

How does hibernating an app work technically?

Hello how are you guys? I was wondering How Hibernating of an app works technically. I know about freezing an app (shell pm disable com.mypackage.name) but this also hides app icon from launcher. I ...
1
vote
2answers
239 views

adb shell check if a certain directory exist on avd

i want to check if a certain directory (/data/textdata/ ) exist on the avd using adb shell. reading adb check if directory exists and push file if it does, i've used the code posted by prolink007 ...
1
vote
1answer
2k views

Running TRIM from shell

Is it possible to run fstrim in stock android 4.3 from adb shell? I understand it runs every 24 hours when the device is plugged in and idle but I would like to run on demand to test a few theories.
1
vote
1answer
1k views

Android shell script permissions? [duplicate]

I have a rooted phone, and I was playing around with Terminal Emulator. I tried writing a simple shell script (test.sh) : #!/bin/sh echo "Hello, World!" Then I opened terminal emulator, cd'd to ...
1
vote
1answer
263 views

Make iso of sdcard + data directory

I need to be able to make an iso file of the /mnt/sdcard and /data/ directories on both rooted and nonrooted phones(for forensic analysis). Older phones I can mount to my linux machine and run mkisofs ...
1
vote
1answer
1k views

Shell utterly borked, toolbox claims “no such tool”

HTC Magic, rooted with CyanogenMod 5. Tried to install busybox using "Busybox Installer" from the Market, ended up with a strangely borked system. Android does not boot, freezes on the splash screen. ...
1
vote
1answer
17 views

How can I syncronize android time with machine via ADB

How can I update android time via ADB? I know I can run this comand via windows cmd: adb shell date -s 20140414.130000 But I need to synchronize the time with my windows machine. Is this possible ...