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

3
votes
3answers
2k 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
1answer
14 views

How to write android shell history to file

Using Terminal Emulator for Android, is there a way to enable a persistent command history? So far, I've tried the following: initial command of export HISTFILE=$HOME/.mksh_history user mksh ...
0
votes
0answers
43 views

External microSD R/W access problem (write works through Shell/SSH though!)

fellow Android enthusiasts! I am having problems with my device's external microSD card. The card seems to be in a read-only mode: I can't format it using my laptop's sdcard reader and diskpart, nor ...
1
vote
2answers
2k views

Check if a certain directory exists on AVD using ADB command

I want to check if a certain directory (e.g. /data/textdata/) exists on the AVD using adb shell. I'm following prolink007's answer on SO, except this line: DIR_RESULT=$(adb shell ls /data/ | tr -d '\...
4
votes
1answer
2k views

Simulate missed call from ADB shell

On the ADB shell, I run the command adb -s <serial_number> shell am start -a android.intent.action.CALL -d tel:123456 to place a call on my testing device. It works great. But I also want to ...
2
votes
1answer
44 views

Is there a non-app tool for batch backup of APK files?

Just as the other times, an answer to my question shall not contemplate an app from either the Play Store, or any other source. What I'm after, is a tool capable to backup user apps, system apps or ...
24
votes
5answers
81k 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 /...
0
votes
0answers
43 views

chroot: can't execute /init.sh: Permission denied - Error while want to start linux on Android

Introduction: I formatted a SDCard in ext4 and copied an ArchVersion on it to run it from Android like in this guide (step 7). Of course my device is rooted and I am running the following scripts and ...
0
votes
0answers
13 views

adb syntax not proper

I want to root, change bootloader and install TWRP on my wife's LG LH410. I found out script to do this on xda-developers. But after unpack zip file, I notice that bat file contains such lines (...
0
votes
1answer
76 views

Reason for chroot failure: tmp-mksh: chroot: not found

Introduction: I formatted a SDCard in ext4 and copied an ArchVersion on it to run it from Android like in this guide (step 6). Of course my device is rooted and am running the following scripts and ...
0
votes
0answers
2k views

adb>shell returns “error: closed” - how to “open” adb shell access through adb sideload

my device got broken but i am still able to connect usb in the stock recovery mode. if i try to start a shell via adb while the device is in recovery mode, i fail. my terminal echos the line: "error: ...
1
vote
0answers
44 views

adb device not found after reboot

I am developing an automated test script to turn off my android device and turn it on back again and then run a few adb commands after the boot is complete. My problem is that when I turn the device ...
4
votes
2answers
10k 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 ...
0
votes
1answer
31 views

Samsung Galaxy Tab 2 10.1 rmnet0 interface non existent

I was wondering, why in my Samsung Galaxy 2 tablet I can't see any rmnet0 interface after executing: adb shell cat /proc/net/xt_qtaguid/stats Or: adb shell netcfg I know this a wifi only device, ...
0
votes
1answer
108 views

how to take complete backup of my android device using adb [duplicate]

I'm trying to take full backup using adb backup -all -f <path> and it took backup and stored in my PC. When I try to restore it using adb restore <path> then it restores onto the target ...
2
votes
3answers
4k views

How do i recover my wifi pass from android using adb?

I'm connected to a wifi spot with my android, but i'd like to connect with my laptop aswell. I don't want to root my phone (warranty and stuffs) nor reset the router, as it has complex settings on it. ...
0
votes
0answers
17 views

ADB ls doesn't sort by name

Why ls in adb shell doesn't sort by name? Here is what I am getting in adb shell: AccuWeather apkfiles.com.apk.tar Amazon Shopping apkfiles.com.apk.tar GO Weather EX V5 apkfiles.com.apk.tar ...
0
votes
1answer
23 views

How to check if a package is enabled via shell?

I have been writing a tasker task to enable/disable a package. I know adb shell pm enable com.android.contacts will enable the package and adb shell pm disable com.android.contacts will ...
0
votes
1answer
21 views

Can I launch a shell script from home screen?

There's one tweak of my phone I'm applying/removing through two some pretty simple shell scripts. But going to terminal emulator and typing the script names each time aside, the tweak actually makes ...
2
votes
2answers
872 views

Where in the filesystem are settings saved? Namely ADB backup password

Where in the phone filesystem are settings saved? I've lost my ADB backup password and simply want to delete it. If it affects other settings that won't matter too much. I will be interfacing the ...
1
vote
0answers
24 views

Run Android on Android?

We know it is possible to use chroot to run full Linux on android, also support Xserver (GUI).So, it should also be possible run another android on an exist android ? for example, using chroot to run ...
2
votes
1answer
2k views

How to find out currently running user name/ID from ADB

I am having Nexus 7 running multiple users. I am trying to find out which is currently running user using ADB. The best I could get so far was to check legacy directory linking which is either linked ...
17
votes
3answers
17k views

Is it possible to activate the “USB Tethering” Android setting 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 ...
0
votes
0answers
24 views

Adb read contents of an Alert Dialog

i have an android phone connected to my pc, using ADB i can run some commands to the device and get output, now am in a situation where i want ADB to read the contents of an Alert dialog. i have been ...
7
votes
2answers
22k views

Starting an activity listed under “Settings” from terminal (or adb shell)

I would like to start this activity from terminal: com.android.settings.Settings$PowerUsageSummaryActivity I tried am start -S com.android.settings/.Settings$PowerUsageSummaryActivity and this is ...
1
vote
1answer
2k views

How do I mount an NFS share on an CM 12?

I'd like to mount an NFS share on my Android cell phone, with perhaps a mount-unmount button on the home screen. Any ideas of how to accomplish this? My /system/lib/modules is empty. It doesn't have ...
0
votes
2answers
875 views

How to pull mmcblk0 to a windows pc?

So here is what i want to pull : mmcblk0 whith it's size 15.7 GB. C:\adb>adb shell shell@android:/ $ su su shell@android:/ # fdisk -l /dev/block/mmcblk0 fdisk -l /dev/block/mmcblk0 Disk /dev/...
0
votes
1answer
55 views

Getting absolute path with “ls” command

Is it possible to output the absolute file path when executing ls -l on Android (e.g. via adb shell or in a terminal app)? Here is the output I get from ls -l /etc/ (I have root access): E:\Dropbox\...
0
votes
0answers
33 views

Run script in smanager script manager fails with “no such file or directory”

I have tried to run 3g turbocharger script in my Android phone with smanager as root, but it doesn't work. The result is no such file or directory How can I get this to work correctly?
3
votes
1answer
315 views

How to kill dhcpcd?

The following command works perfectly to start DHCP: # dhcpcd -p eth0 DHCP cannot be stopped once it is started. The following command does not work: # dhcpcd -k eth0 It returns the following: ...
4
votes
2answers
9k 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?
1
vote
1answer
92 views

Is there a shell command to open Ethernet settings?

To open the Wi-Fi settings, one can use the following command: # am start -n com.android.settings/.Settings\$AdvancedWifiSettingsActivity Is there a similar command to open the Ethernet settings ...
0
votes
0answers
36 views

mount in shell as user or root with different output

I have a rooted Android Phone and a native service which detects if the system partition is mounted read-write or read-only. If I run the mount command in the user shell, the partition is mounted ...
0
votes
1answer
76 views

How can I get shell access on my almost dead phone

My phone broke, so I have been messing with it and from the errors I can see, it looks like all the system folders are missing. /system /data etc. I saw a YT video where the guy used ADB shell to ...
7
votes
1answer
1k 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?
1
vote
0answers
140 views

How to enable/disable DHCP of eth0

"ifconfig eth0 dhcp start" or "ifconfig eth0 dhcp drop" does not seem to work for Android. Is there a way to enable/disable DHCP for eth0 via shell commands?
21
votes
3answers
23k 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 ...
3
votes
3answers
264 views

Work-around for process substitution in mksh

An extremely useful feature of Bash, known as process substitution, is missing in the Android shell, mksh. This is highly unfortunate as it prevent you from doing things like: diff <(sort list1) &...
2
votes
1answer
86 views

Shell .profile or /etc/profile for old android 2.3.3

Just rooted my old phone with Android 2.3.3 and I would like to define some aliases for each shell I start (with adb or terminal app). I found this question where one answer says that /etc/profile (=/...
1
vote
2answers
109 views

Does “ifconfig wlan0 dhcp status” work for Android?

I cannot get any response from an Android device (Android 4.2) to command "ifconfig wlan0 dhcp status" Command "ifconfig wlan0" returns the following: wlan0: ip 192.168.0.14 mask 255.255.254.0 flags ...
3
votes
0answers
45 views

How does changing IP and mask by ifconfig work?

I am sorry for this rudimentary question, but I cannot find a good answer. Here is the effort to change IP and mask: # ifconfig eth0 eth0: ip 192.168.0.133 mask 0.0.0.0 flags [up broadcast running ...
0
votes
1answer
121 views

Help! Renamed /system/bin/sh to sh.old.bak, lost root, can't rename, no nandroid backup

I did something incredibly stupid today. I renamed /system/bin/sh to /system/bin/sh.old.bak on my rooted Huawei y536a1 running 4.4.3 KK. I was going to install a app I thought might overwrite it ...
6
votes
3answers
9k 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
3answers
732 views

Run downloaded shell command without root?

My phone is a Galaxy S3, not rooted. I have "ES File Explorer" and "Terminal Emulator" installed. I downloaded an Android build of 'wget', intending to execute it from the Terminal Emulator app. ...
3
votes
0answers
330 views

Nexus 6 automatically remounting system read-only, deleted files returning

tl;dr I mount system rw I try to copy/update/write /system/xposed.prop System is auto-remounted ro, causing the write to fail (applicable to a variety of workarounds) Moving/renaming/deleting files ...
1
vote
0answers
103 views

Cannot mount mtdblock partition

I'm trying to mount the boot partition of a tablet with MTD partitions. This is the output of cat /proc/mtd: root@android:/ # cat /proc/mtd dev: size erasesize name mtd0: 00400000 00004000 "...
20
votes
3answers
94k views

How to start root shell with Android Studio?

I just installed Android Studio. How do I get into root shell on my phone? Or do I have to download ADB separately?
36
votes
3answers
83k 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 ...
0
votes
0answers
87 views

How to run alsamixer command for android shell

I am trying to configure sound for a specific sound card and I need AlsaMixer to open but I can't find the right command to open it from terminal. Any help would be appreciated
0
votes
0answers
23 views

Change path via script?

Currently, after I shell into my devices I run this script: #!/system/bin/sh export PATH=$PATH:/data/local/tmp echo $PATH /system/bin/sh The sh at the end of the script inherits the new path from ...