Questions tagged [shell]

The shell is a piece of software that provides a 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 the full tag wiki for other related tags.

Related Tags

  • : about e.g. execute shell commands via adb shell
  • : general questions about command-line use
  • : about scripting of shell commands
  • : about automatizing shell commands using Tasker
  • : using a terminal app to execute shell commands

shell-specific

  • old Android versions used ash as system shell
  • some old aftermarket ROMs used sh as system shell
  • some aftermarket ROMs add as shell
  • : the system shell on Android 4+, Android-x86 2.2+, and some other ROMs

External Links

414 questions
22
votes
2 answers

What useful Android Shell commands do you know?

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 thread to compile a list of "useful" Android commands.…
n3rd
  • 507
  • 1
  • 6
  • 8
8
votes
1 answer

How to execute commands, after exiting ADB shell?

I'm coding a script to automate an application configuration export process. adb shell ... ... exit The problem is: after saving the backup I want to pull the file to my computer, using…
jurordrained
  • 153
  • 8
5
votes
2 answers

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. I can get this info in my Ubuntu, but I could not…
user18345
  • 51
  • 2
3
votes
2 answers

ls -b in android shell

If im not mistaking, using ls -b should output escape characters with some sort of representation, but it seems like this option isn't available. Is there an alternative, or is it impossible to have a filename with escape characters on android?
Moshe Magnes
  • 131
  • 1
  • 2
3
votes
1 answer

Change TMPDIR for Android shell script

I am working on a script that will be run from an android shell (e.g. adb shell). I have a problem with writing temporary files, as this demonstrates: $ cat <<-EOF > foo > EOF sh: can't create temporary file /data/local/shd1v7x1.tmp: Permission…
starfry
  • 455
  • 3
  • 11
3
votes
1 answer

What does "svc power stayon wireless" do?

Looking at the reference to svc on my phone there are options for svc power stayon [true|false|usb|ac|wireless]. I'm curious what usb, ac, and wireless do when you use them? I tried svc power stayon wireless and it seemed the command succeeded, but…
I like to code
  • 133
  • 1
  • 6
1
vote
0 answers

Writing Script to add eth0 interface on S7 edge

can someone take a look over this script? I want to add it in a sh file. When I connect my ethernet adapter I don't want enter all commands again. I just want to execute it from shell. Is this correct? #!/bin/sh ip link set eth0 up sleep 1; ip addr…
user314662
  • 21
  • 3
1
vote
0 answers

Serial console user belongs to less groups than adb shell

Even though the user is the same uid=2000(shell), still the output of group is very different when run on adb shell (rooted device) than on serial console. So it seems that through adb shell the user belongs to more groups than when logged in on a…
dragi
  • 111
  • 3
1
vote
1 answer

Android Phone Shell Command Silent Mode?

What is the shell command to enable/toggle silent mode on an Android phone? I ask because the Tasker app can run shell commands but only can enable vibration for my specific phone model.
Ahmed
  • 171
  • 1
  • 8
1
vote
0 answers

android shell /system/bin/sh subshell not working

The script #!/system/bin/sh /system/bin/busybox find . f=$(/system/bin/busybox find .) echo $f for f in $(/system/bin/busybox find .) do echo $f done does not work as expected in my environment. I get: . ./loop.sh while bash loop.sh…
Wolfgang Fahl
  • 111
  • 1
  • 5
1
vote
0 answers

Can't change clock frequency (android)

I try to change clock frequency to lower frequency (android), but although I get no error, it keeps using the other frequency. < root@w812a_kk:/sys/devices/system/cpu/cpu0/cpufreq #…
ransh
  • 339
  • 3
  • 12
0
votes
0 answers

Where to find info on the "service call" shell command?

Using adb shell or a terminal emulator on the device, entering this will clear all notifications (requires su) service call notification 1 This will send an sms (doesn't require su) service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16…
Corey Ogburn
  • 480
  • 6
  • 15
0
votes
0 answers

Android: how to grant 666 privs to a device via ueventd.rc

I need to access an USB camera connected to my (rooted) Android. I'm on a Samsung Galaxy S4 with Android 4.2.2. I want to access it with a normal app, so I need the device to be world readable. I can connect via shell and type root@android:/ #…
Zontar Ian
0
votes
0 answers

Run oneliner shell command in Tasker does not work

When using Tasker as a clipboard manager I made a shell script which reads the last clipping (also successfully captured by Tasker, in /storage/emulated/0/clipper/clip.txt). This I append to a file with all clippings with a maximum of 300 lines. I…
0
votes
0 answers

What and when clears content of /data/local/tmp?

I plan to copy and start precompiled binary from /data/local/tmp and I would like to get any information one edge cases that might cause some potential issue, like - what and when this folder being cleared out during either normal OS operation or…
Kirikan
  • 79
  • 1
  • 6
1
2