Rooting LG V20 H990DS? - LG V20 Questions & Answers

Been reading this guide here --» https://forum.xda-developers.com/v20/development/dirtysanta-h990-t3624296
despite much of a mess that it is and poorly written in some regards. I can make perfectly good sense of it all, but the commands issued most of them are pretty useless, or don't work as they're instructed to do.
Let me point out some stuff here, cuz I'm trying to work my way through the tutorial to root my LG V20 H990DS (International) btw;
ok so the first part here it explains the following;
6. Using dirtysanta's steps: Run "RUNMEFIRST.bat" <-- Do not close.
7. Run "step1.bat" <-- Wait until you can type something again.
Click to expand...
Click to collapse
in my case here I'm using Linux, not Windows to do this, so things are simpler, the RUNMEFIRST.sh executable literally does nothing, when I can see it clearly is suppose to do something, let's take a look at what that files trying to run;
Code:
#!/bin/sh
# runmefirst.sh
#
#
# Created by me2151 on 12/13/16.
#
adb logcat | grep -a dirtysanta
OK, so it's using logcat to see what the phone is doing while piping to grep to watch out for dirtysanta being written to the phone while you have step1.sh running in another terminal instance, when that command completes you're left in ADB Shell of your device. Meanwhile the first shell script doesn't report anything going on, OK that's fine, doesn't matter since it wrote the contents of the required files to the phone, so it's there, as it should and as it's described in the shell script;
Code:
#!/bin/sh
# Step1.sh
#
#
# Created by me2151 on 12/11/16.
#
adb push dirtysanta /storage/emulated/0
adb push aboot.img /storage/emulated/0
adb push dirtycow /data/local/tmp
adb push my-run-as /data/local/tmp
adb shell chmod 0777 /data/local/tmp/*
adb shell /data/local/tmp/dirtycow /system/bin/run-as /data/local/tmp/my-run-as
adb shell /data/local/tmp/dirtycow /system/bin/applypatch /data/local/tmp/dirtycow
adb shell
Now this next part, doesn't work at all, because in the tutorial guide, they said to do chmod 777 permissions on "/storage/emulated/0/*" this doesn't work because operation is not permitted by the file owner and group root, there is no write permission to change permissions of that directory structure.
Code:
chmod: chmod '/storage/emulated/0/Android' to 40777: Operation not permitted
and yes /storage/emulated/0/ is suppose to be your storage userspace of where you save your files and stuff. Your "virtualized" SD Card space, you have normal read-write access there anyways. The next part of that tutorial says to check the id output from the Terminal Emulator app on Android, and check for the response "untrusted_app", that I do get, if you're doing it through ADB Shell you'll get "context=u:r:shell:s0" instead.
Part 12 of the tutorial has misuse or incorrect command line usage for applypatch, it will not simply execute because the command line usage is incorrect like so;
Code:
applypatch /system/bin/atd /storage/emulated/0/dirtysanta
it'll just simply return the following;
Code:
usage: applypatch [-b <bonus-file>] <src-file> <tgt-file> <tgt-sha1> <tgt-size> [<src-sha1>:<patch> ...]
or applypatch -c <file> [<sha1> ...]
or applypatch -s <bytes>
or applypatch -l
Filenames may be of the form
MTD:<partition>:<len_1>:<sha1_1>:<len_2>:<sha1_2>:...
to specify reading from or writing to an MTD partition.
obviously the step2 shell script can't do anything because there is nothing to backup, since it's calling to backup the boot images off the device.
So far I haven't been able to find any comprehensive or updated rooting guide for LG V20 H990DS in particular, nothing new worked on seems to popup anywhere as of yet.

bump this

No help for this at all? Just gonna be another one of those dead-end topics with no answers?

Related

Dealing with busybox LS output in Windows

If you are using ADB Shell on a Windows machine and try to LS with busybox on your phone it will add color coding along with directory and file names.
To get rid of this you need only need to type [1] in the command prompt.
If you would like an LL type function added you can also put in [2].
[1] alias ls='ls --color=never'
[2] alias ll='ls -la --color=never'
Is there any way to get these aliases to stick?
The aliases go away every time I open a new ADB Shell. :\
##########edit1
I found that you can use PuTTYcyg to properly display the colors if you have Cygwin installed on your machine.
I just selected "Cygterm" for "Connection type" and put "adb shell" in "Command (use - for login shell)".
I would still like to have an alias for LL at least if we can figure out a way to get the aliases to stick.
Thanks!
##########edit2
In case people have no idea what I'm talking about.
Busybox LS output with color in Windows CMD:
Code:
# ls
ls
←[1;34mcache←[0m ←[1;36metc←[0m ←[1;34mroot←[0m
←[1;34mconfig←[0m ←[1;32minit←[0m ←[1;34msbin←[0m
←[1;36md←[0m ←[1;32minit.desirec.rc←[0m ←[1;34msdcard←[0m
←[1;34mdata←[0m ←[1;32minit.goldfish.rc←[0m ←[1;34msqlite_stmt_journals←[0m
←[0;0mdefault.prop←[0m ←[1;32minit.rc←[0m ←[1;34msys←[0m
←[1;34mdev←[0m ←[0;0mlogo.rle←[0m ←[1;34msystem←[0m
←[1;34memmc←[0m ←[1;34mproc←[0m
Busybox LS output without color in Windows CMD:
Code:
# ls --color=never
ls --color=never
cache etc root
config init sbin
d init.desirec.rc sdcard
data init.goldfish.rc sqlite_stmt_journals
default.prop init.rc sys
dev logo.rle system
emmc proc
And now color just looks like one of the weirdest words to me after looking at it for so long....
COLOR.
I got an LL going if anyone is interested. Basically using this guys instructions but making it for ll instead of dir.
1) Create a file named ll in /system/xbin
With this in it [NO COLOR]:
Code:
#!/system/xbin/sh
ll(){
ls -la --color=never [email protected]
}
ll [email protected]
OR
With this in it [COLOR]:
Code:
#!/system/xbin/sh
ll(){
ls -la [email protected]
}
ll [email protected]
2) Set file ownership/permissions
Get an ADB Shell:
Code:
cd /system/xbin
chown 0 ll
chmod 755 ll
The LL command will work immediately after setting ownership/permissions on the LL file. It's a workaround for now but works great.
Updated first post.
Not at all
The shortest way to do it is:
Code:
# alias ls="ls --color=never"
What I wonder is how to get rid of the annoying ECHO..
Long term fix?
Any better ways to fix this? I never used to have this problem, but all of a sudden, after messing with ADB over WiFi, now I do have this problem
http://forum.xda-developers.com/showthread.php?p=14564633
The alias only works for a single cmd session
update
ScottHW said:
Any better ways to fix this? I never used to have this problem, but all of a sudden, after messing with ADB over WiFi, now I do have this problem
Click to expand...
Click to collapse
Small update: I noticed that I actually only have the problems with ls -al when the phone is fully booted. When I use adb booted in Recovery (CWM) the file listings are fine.
It's possible that I have never used adb while the phone is fully booted before, and just assumed that the Recovery behavior was universal and when I got the funky behavior, it wasn't messing around with ADB, it was just because I didn't know what "normal" was.
Short term fix is still just to use an alias for ls
But you have to redo it every time you restart adb

Allow Non Market Apps on Captivate

I see there is already a method to update non market app installs(sideloading), however it requires you buy Root Explorer(which is a good app to buy), but here is a guide for us cheap people:
This requires that you have already rooted your phone.
WINDOWS from the android sdk tools folder in a command prompt:
Code:
adb shell
su
chmod 666 /dbdata/databases/com.android.providers.settings/settings.db
exit
exit
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
echo update secure set value = 1 where name = 'install_non_market_apps';|sqlite3 settings.db
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
LINUX/MAC from the android sdk tools folder in a terminal:
Code:
./adb shell
su
chmod 666 /dbdata/databases/com.android.providers.settings/settings.db
exit
exit
./adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
echo "update secure set value = 1 where name = 'install_non_market_apps';"|./sqlite3 settings.db
./adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
Thanks to ATTN1 and FluffyArmada, most of it was stolen from the HTC Aria.
Thank you... I was trying to do this last night and kept having permissions problems.
the last step shld be
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
Thanks, fixed the typos.
If I start a adb shell and add su, I get a access denied message.
Thanks for any help.
Shouldn't the line for pushing the file be:
Code:
./adb push [b]settings.db[/b] /dbdata/databases/com.android.providers.settings/settings.db
for linux/mac?
Thanks for the tutorial, by the way!
Edit: wow, nevermind, it's already been posted. That's what I get for not reading (and comprehending) the thread.
You're missing the first settings.db in the last command for windows. It should read
Code:
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
smitty1 said:
If I start a adb shell and add su, I get a access denied message.
Thanks for any help.
Click to expand...
Click to collapse
Go to the homescreen of your phone, then type su in the command prompt. The Superuser app should pop up and ask for permission, just allow it then continue like normal.
unclejimbo88 said:
You're missing the first settings.db in the last command for windows. It should read
Code:
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
Click to expand...
Click to collapse
Thanks, don't know how I missed that, I've updated the post.
no settings.db file
Hello,
Thank you for the video instructions.
shad0wf0x, I tried to input the command lines but it was stating:
Unable to chmod /dbdata/databases/com.android.providers.settings/settings.db: Operation not permitted
How do I get around that? Also, I looked in the phone's root directory and didn't see a folder named "dbdata".
Thank you in advance.
***Edit: Nevermind, I got it to install the way you showed on how to install SirusXM. Thank you.***
I've tacked this method into the consolidated thread, we're up to 5 methods now.
http://forum.xda-developers.com/showthread.php?t=738376
Even better, Sideload Wonder Machine. Doesn't even require root access.
Link to the app.
I'll reply in the my thread, so..
We really need a thank you system, really appreciate the spread of knowledge here, thanks
Got it to work perfectly for me, the other methods seem so much longer and more steps, this was very easy.
But you need to add one final step, turn off your phone and turn it back on or 'reboot' basically..
Thank you very much!
/dbdata/ is empty
This has been driving me bonkers for the past few days...I can't change settings.db because I don't HAVE settings.db. (And I get an 'insufficient permissions for device' error using ./adb shell anyway.) /dbdata/ is completely empty. A search from ASTRO shows no results for com.android.providers.settings or settings.db.
I have no idea what to do! None of these methods work for me, because they are all doing the same thing: editing a file which does not exist on my phone. (I should also point out that I don't really have access to a windows machine right now.)
Thanks in advance. Any help is appreciated.
MacBook:~ User$ cd /Users/User/Desktop/AndroidHacks/SDK/platform-tools
MacBooklatform-tools User$ ./adb shell
$ su
# chmod 666 /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
MacBooklatform-tools User$ ./adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
1865 KB/s (52224 bytes in 0.027s)
MacBooklatform-tools User$ echo "update secure set value = 1 where name = 'install_non_market_apps';"|./sqlite3 settings.db
-bash: ./sqlite3: No such file or directory
MacBooklatform-tools User$ ./adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
815 KB/s (52224 bytes in 0.062s)
What did i do wrong exactly?
Help please
It appears you do not know what the following line is doing:
echo "update secure set value = 1 where name = 'install_non_market_apps';" | ./sqlite3 settings.db
The | character is called "pipe". It pipes the output of one command to the input of the next. In that line "echo" is a command and so is "sqlite3". The ./ prefix to sqlite3 is an explicit path to the command. Any path the begins with ./ is relative to your "current working directory". So, the original poster is assuming that you are doing this process from a location where there is a copy of sqlite3 in the current directory. And based on the error you got...
-bash: ./sqlite3: No such file or directory
...clearly this is not true.
I'm pretty sure that the Mac has sqlite3 present in the base install, and that it is located within your system $PATH (to be exact, /usr/bin/sqlite3). This means that you ought to be able to run that line without the explicit path. (That is to say change "./sqlite3" to "sqlite3".) Then you can do the "push" line again and you are set.
There is a lot of information in this post. Learn what it all means. The world has changed. Mac power users now have to know this stuff. Once you are comfortable with the idea of commands and piping, research $PATH, you'll learn something.

EVO Shift Temp Root for 2.3.3 and HBoot Downgrade

To downgrade your HBOOT to go back to 2.2 visit this link http://forum.xda-developers.com/showthread.php?t=1255474
This will allow you to flash 2.2 to perm root the phone
If you wish to help with perm root status for Android 2.3.3, please visit this thread http://forum.xda-developers.com/showthread.php?t=1218580
Thanks to everyone in this post who has helped get this far. You will need to have the Android SDK installed and working knowledge of ADB and basic file system structure.
Major help from minneyar
TEMP ROOT Instructions:
Download http://tinyw.in/1lI
Unzip if required and put in your ADB folder
Launch command prompt and navigate to your ADB folder
adb push fre3vo /data/local/tmp/
adb shell
chmod 777 /data/local/tmp/fre3vo
/data/local/tmp/fre3vo -debug -start fbb58a00 -end FFFFFFFF (if this doesn't work, try rebooting phone)
Download these 2 files here and put them in your ADB directory: http://forum.xda-developers.com/showthread.php?p=14927732#post14927732
exit back to command prompt if you aren't there already
adb push Superuser3-beta1.apk /data/app/
adb push su-3.0-alpha7 /data/local/tmp
adb shell (should now see # instead of $)
cd /data/local/tmp
chmod 777 su-3.0-alpha7
./su-3.0-alpha7
cd /
mount -o remount,rw -t rootfs rootfs /
rm vendor
mkdir vendor
mkdir vendor/bin
cat /data/local/tmp/su-3.0-alpha7 > /vendor/bin/su
chmod 4755 /vendor/bin/su
You now have temp root. Disregard any notification about outdated SU binary. Root will go away if you reboot. If you reboot your phone you can obtain root again by just running the following
adb shell
chmod 777 /data/local/tmp/fre3vo
/data/local/tmp/fre3vo -debug -start fbb58a00 -end FFFFFFFF
adb shell (should now see # instead of $)
cd /data/local/tmp
chmod 777 su-3.0-alpha7
./su-3.0-alpha7
cd /
mount -o remount,rw -t rootfs rootfs /
rm vendor
mkdir vendor
mkdir vendor/bin
cat /data/local/tmp/su-3.0-alpha7 > /vendor/bin/su
chmod 4755 /vendor/bin/su
I haven't found a way to re-root after rebooting without connecting to a PC
Type su and see if it gives you root permissions
Sent from my MiuiSpeedy
says su: not found.
You are saying you cannot install the superuser app? From reading in the Evo3D forums, you could install Superuser, even without being rooted, but it obviously won't allow root access, until you run a root exploit.
Try rebooting the phone, installing superuser, run fre3vo, and then try the adb shell, and su method.
This is getting interesting. Hopefully you are on to something.
Stuke00 said:
See screenshot. Doesn't the # mean temp rooted? Tho I cannot install SU and Root Explorer isn't working. Anything else I need to do first or something?
Click to expand...
Click to collapse
Looks hopeful!
tokuzumi said:
You are saying you cannot install the superuser app? From reading in the Evo3D forums, you could install Superuser, even without being rooted, but it obviously won't allow root access, until you run a root exploit.
Try rebooting the phone, installing superuser, run fre3vo, and then try the adb shell, and su method.
This is getting interesting. Hopefully you are on to something.
Click to expand...
Click to collapse
Okay let me clarify
I can install SU but it wouldn't install the binaries. I did all of the above. Says su: not found.
I then tried something else.
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cat /system/bin/sh > /system/bin/su
# chmod 4755 /system/bin/su
I was then able to get the SU binaries to install but Titanium Backup says:
"Busybox works but the "su" command does not elevate to root: "whoami" reports "app_135" instead of root/uid 0.
then su from the command prompt was saying "link_image[1935]: 3160 missing essential tablesCANNOT LINK EXECUTABLE" and now back to su: not found again....
I don't know enough about linux commands to give you any real info. Like in the other thread, talk to agrabren, to see what he has to say.
tokuzumi said:
I don't know enough about linux commands to give you any real info. Like in the other thread, talk to agrabren, to see what he has to say.
Click to expand...
Click to collapse
Yeah I tweeted him with what I could provide with 160 characters. Just waiting now.
Well here's a tweet he put out a couple of hours ago.
@agrabren: For those with the SHIFT, it's a known bug in my code that we missed the address. One too many zeroes in the list. I'll try to fix it soon.
Sent from my PG06100 using XDA App
crump84 said:
Well here's a tweet he put out a couple of hours ago.
@agrabren: For those with the SHIFT, it's a known bug in my code that we missed the address. One too many zeroes in the list. I'll try to fix it soon.
Sent from my PG06100 using XDA App
Click to expand...
Click to collapse
Yeah he posted that right after I gave him the memory address for the exploit. Just means that I did it the manual way through debugging. At least I think so... hopefully soon!
Good news, everybody! I have successfully acquired temp root on my Shift!
First, fre3vo has to be pointed at the right address. After copying it over to my phone, I did "adb shell" and then ran it like so:
/data/local/tmp/fre3vo -debug -start fbb58a00 -end FFFFFFFF
That printed out a message that it found an exploit and kicked me out of the shell. After doing "adb shell" again, I got a command prompt. I tried installing the 2.3.6.3 version of Superuser, but it complained about being unable to install "su"; I tried to find a separate su binary and copy it over manually, but it didn't work due to a linker error.
After searching around, I found a beta version of Superuser 3:
http://forum.xda-developers.com/showthread.php?p=14927732#post14927732
First I uninstalled the old version of Superuser and then used adb to install the new one from that thread. I ran it and it said it was unable to install su, so I downloaded the version of su provided there and installed it manually. The process went something like:
Code:
adb push su-3.0-alpha7 /data/local/tmp
adb shell
# cd /data/local/tmp
# chmod 4755 su-3.0-alpha7
# ./su-3.0-alpha7
# mount -o remount,rw -t ext3 /dev/block/mmcblk0p26 /system
# cat su-3.0-alpha7 > /system/bin/su
# chmod 4755 /system/bin/su
I don't know if explicitly running "./su-3.0-alpha7" is necessary, it just seemed like a good idea at the time. I don't know if everybody's block device will be named "mmcblk0p26", I used "mount" to figure out what was mounted at /system.
Anyway, after all that was done, I ran Superuser again and it didn't complain. To test it out, I started up Wireless Tether. It asked me for superuser permissions, which I granted it, and it's working fine.
Root successful!
Good job!!
Sent from my Speedy HTC EVO shift on XDA Premium app
I followed those steps exactly and got what I would call a partial root. Some of the 'you need root' errors are gone but "su" still results in 'not found' even though "mkdir su" results in 'file exists.'
mmcblk0p26 exists on this unit.
The weirdest part is that Adfree will accept the device as rooted and with superuser but says it can't find a partition to modify. And after a reboot root is definitely gone.
I think you're on to it but it isn't quite there yet.
It seems to be fully temprooted to me; I have to redo it if I reboot, but otherwise it's working perfectly. After following the steps I listed above, running "ls -l /system/bin/su" should produce this output:
Code:
# ls -l /system/bin/su
ls -l /system/bin/su
-rwsr-xr-x root root 22228 2011-07-25 19:14 su
If it says "No such file or directory" instead, then the su binary isn't in the right place.
Looking back over what I wrote, I think I left out a step -- if you were following what I listed exactly, it probably won't work, because I forgot to change to the /data/local/tmp directory. I'll update that...
Update: after playing around with it for a while, something is definitely not quite right. Everything works fine at first; I've tested Wireless Tether and Titanium Backup and they're both fine. After leaving my phone for a while and coming back, though, applications that try to get root access mysteriously fail. The dialog prompt doesn't even appear.
Going back into the adb shell, /system/bin/su is still there, but trying to run "su" causes this to happen:
Code:
# su
su
link_image[1935]: 3802 missing essential tablesCANNOT LINK EXECUTABLE
But if I use cat to overwrite su and then chmod it again, everything works. su must somehow be getting modified by something else and replaced with a bad version... but I'm not sure where to look.
I caught something like that.
I think there should be a chmod 777 su-3.0-alpha7 after cd /data/local/tmp
minneyar said:
It seems to be fully temprooted to me; I have to redo it if I reboot, but otherwise it's working perfectly. After following the steps I listed above, running "ls -l /system/bin/su" should produce this output:
Code:
# ls -l /system/bin/su
ls -l /system/bin/su
-rwsr-xr-x root root 22228 2011-07-25 19:14 su
If it says "No such file or directory" instead, then the su binary isn't in the right place.
Looking back over what I wrote, I think I left out a step -- if you were following what I listed exactly, it probably won't work, because I forgot to change to the /data/local/tmp directory. I'll update that...
Update: after playing around with it for a while, something is definitely not quite right. Everything works fine at first; I've tested Wireless Tether and Titanium Backup and they're both fine. After leaving my phone for a while and coming back, though, applications that try to get root access mysteriously fail. The dialog prompt doesn't even appear.
Going back into the adb shell, /system/bin/su is still there, but trying to run "su" causes this to happen:
Code:
# su
su
link_image[1935]: 3802 missing essential tablesCANNOT LINK EXECUTABLE
But if I use cat to overwrite su and then chmod it again, everything works. su must somehow be getting modified by something else and replaced with a bad version... but I'm not sure where to look.
Click to expand...
Click to collapse
YES! I have root! I was able to install a screenshot app and test it this is amazing progress! Thanks for that.
So now when I reboot, you have to do the entire thing again? SU and all?
Stuke00 said:
So now when I reboot, you have to do the entire thing again? SU and all?
Click to expand...
Click to collapse
Yes, every time you reboot you'll have to redo the whole process, including running fre3vo and then copying su into /system/bin. Hopefully somebody will figure out a permanent root soon.
Wow those SU binaries are disappearing before I even reboot! Already gone and I haven't rebooted the phone
I think I had that issue too. I just couldn't believe the files just disappeared and thought I did something wrong somewhere.
Would a logcat help anyone at all? Anything I should look for?

[Q] need help rooting mytouch 4g 2.3.4

Ok after about 11 hrs I need help I cant get past cd /data/local/tmp says it cant find path and ./misc_version -s 1.00.000.0 cant find path. PLEASE HELP.. Ive rooted my evo's but this is giving me trouble
C:\Users\Josh>adb shell
^C
C:\Users\Josh>adb push fre3vo /data/local/tmp
C:\Users\Josh>adb shell
C:\Users\Josh>adb push misc_version /data/local/tmp/misc_version
C:\Users\Josh>adb push flashgc /data/local/tmp/flashgc
C:\Users\Josh>adb shell chmod 777 /data/local/tmp/*
C:\Users\Josh>adb shell chmod 777 /data/local/tmp/misc_version -s 1.00.000.0
C:\Users\Josh>adb push misc_version -s 1.00.000.0 /data/local/tmp
C:\Users\Josh>adb shell
^C
C:\Users\Josh>./flashgc
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Josh>adb push ./flashgc
C:\Users\Josh>./flashgc
'.' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Josh>cd\adb
The system cannot find the path specified.
C:\Users\Josh>
Why on earth are you Ctrl-Breaking the ADB shell? You're supposed to work in it.
Im lost in it. Ive never really use adb..
When you write "adb shell" you get "$" sign, right? Just keep writing the commands after this sign, as if nothing happened.
Follow the guide exactly. Look at my signature, go to Glacier Wiki, section "Root", subsection "Gingerbread", guide for downgrading. It's written in the most understandable way possible. If you still don't understand - please reconsider rooting until you get familiar with ADB, which is not hard to do - there are guides all over the internet that show how to work with ADB, including video guides.
No when I adb Shell I get #. I did figure out you can get SU permission on terminal emulator when you use Super Tool V3. To me thats a easier temp root.
If you get "#" - it means you're getting a root shell, and good to go.
Just write the ADB commands in it.
Ya I found out what I was doing wrong. I placed a data folder then a local folder and tmp in SD card. Then I got it. But I used super V tool 3 to get temp shell root access. It gave me a better shell root.

[REF][DEV]Terminal Emulator Commands

Always wondered what the terminal emulator app does? Dont now what commands to type? Well this thread is all about that
ALERT!!! ALERT!!
BELOW ARE THE COMMANDS AND THE PROCESSES THAT WILL HAPPEN BY TYPING THE COMMANDS!!!
IF YOU DO NOT UNDERSTAND SOMETHING PLEASE SO NOT TRY IT.. IT IS RISKY AND WILL POTENTIALLY HARM YOUR DEVICE!!
DO NOT BLAME ME THEN!!
THIS IS A REFERENCE AND DEV THREAD. NOOBS SHOULD NOT LINGER AROUND HERE
The Android Shell
A "shell" is a program that listens to keyboard input from a user and performs actions as directed by the user. Android devices come with a simple shell program. This shell program is mostly undocumented. Since many people are curious about it I thought I'd write up some documentation for it.
Currently this documentation is incomplete, sorry!
Click to expand...
Click to collapse
Common problems
The built-in shell has very limited error handling. When you type a command name incorrectly it will say "permission denied", even though the real problem is that it couldn't find the command:
Click to expand...
Click to collapse
Code:
$ dir
dir: permission denied <---- this is a misleading error message, should say 'dir: not found'
$ ls
... listing of current directory
The PATH variable
The Android shell will run any program it finds in its PATH. The PATH is a list of directories. You can find out what your shell's PATH is set to by using the built-in echo command:
Code:
$ echo $PATH
/data/local/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
Depending upon your shell, you may see a different result.
Built in Commands
Every shell has a few built-in commands. Some common built-in commands are:
echo -- prints text to stdout.
set -- sets shell variables
export -- makes shell variables available to command-line programs
cd -- change the current directory.
pwd -- print name of the current directory.
Commands
To find out what commands you have available to you, use the "ls" command on each of the directories in the PATH variable.
Click to expand...
Click to collapse
Finding documentation for the Android commands.
Many of the Android commands are based on standard Linux (or bsd) commands. If you're curious about a command, you can sometimes learn how it works by using the "man" command on a desktop Linux or OSX (Apple Macintosh) computer. The Linux or OSX version of the command may be different in details, but much of the documentation will still apply to the Android version of the command.
Another source of documentation for people without a Linux or OSX machine handy is to use a web browser and use a web search engine to search for the text: "man Linux command-name".
List of commands
The following is a list of the commands that are present on a Nexus S phone running an Android 2.3.3 "user-debug" build. Many of these commands are not present on a "user" phone. (They are missing from a "user" phone because they are specific to developing or debugging the Android operating system.)
Code:
$ ls /data/local/bin
/data/local/bin: No such file or directory
Notice that by default there is no /data/local/bin directory. You can create this directory using the "mkdir" command if you like.
Code:
$ ls /sbin
opendir failed, Permission denied
The /sbin directory exists, but you don't have permission to access it. You need root access. If you have a developer phone, or otherwise have root access to your phone you can see what's in this directory.
Code:
$ su
# ls /sbin
ueventd
adbd
# exit
$
Notice that the shell prompt changes from a '$' to a '#' to indicate that you have root access.
Click to expand...
Click to collapse
Notice also that neither of the /sbin commands are useful to the shell -- the adb and ueventd files are 'daemon' programs used to implement the Android Debugger "adb" program that is used by developers.
Code:
$ ls /vendor/bin
gpsd
pvrsrvinit
Vendor/bin is where device vendors can put device-specific executables. These files are from a Nexus S.
Code:
$ ls /system/sbin
/system/sbin: No such file or directory
This directory does not exist on a Nexus S.
Code:
$ ls /system/bin
am
am is the Android Activity Manager. It's used to start and stop Android activities (e.g. applications) from the command line. Type am by itself to get a list of options.
Click to expand...
Click to collapse
Code:
amix
aplay
Command line audio file player.
Code:
app_process
applypatch
Used to apply patches to android files.
Code:
arec
Command line audio recorder.
Code:
audioloop
bluetoothd
BlueTooth daemon
Code:
bmgr
Backup manager - type command by itself to get documentation.
Code:
bootanimation
Draws the boot animation. You may have to reset your phone to get out of this.
Code:
brcm_patchram_plus
bugreport
cat
Copy the contents of a file to standard output.
Code:
chmod
Change the mode of a file (e.g. whether it can be read or written.)
Code:
chown
Change the owner of a file.
Code:
cmp
Compare two files byte-by-byte
Code:
dalvikvm
The dalvik virtual machine. (Used to run Android applications.)
Code:
date
Prints the current date and time
Code:
dbus-daemon
dd
Convert and copy a file. By default copies standard in to standard out.
Code:
debuggerd
dexopt
df
Shows how much space is free on different file systems on your device.
Code:
dhcpcd
dmesg
dnsmasq
dumpstate
dumpsys
dvz
fsck_msdos
gdbserver
getevent
getprop
gzip
hciattach
hd
id
ifconfig
iftop
ime
input
insmod
installd
ioctl
ionice
iptables
keystore
keystore_cli
kill
Send signals to processes.
Code:
linker
ln
Used to set up a file system link.
Code:
log
logcat
Prints the Android runtime log.
Code:
logwrapper
ls
Lists files.
Code:
lsmod
lsof
make_ext4fs
mediaserver
mkdir
Make a directory.
Code:
monkey
A program that sends random events, used to test applications. (Like having a monkey playing with the device.)
Code:
mount
mtpd
mv
Move a file from one directory to another. (Only on the same file system. Use "cat a > b" to copy a file between file systems.
Code:
nandread
ndc
netcfg
netd
netstat
newfs_msdos
notify
omx_tests
pand
ping
pm
pppd
printenv
ps
List active processes.
Code:
qemu-props
qemud
racoon
radiooptions
reboot
Reboot the device.
Code:
record
renice
rild
rm
Remove a file.
Code:
rmdir
Remove a directory.
Code:
rmmod
route
rtp_test
run-as
schedtest
schedtop
sdcard
sdptool
sendevent
service
servicemanager
setconsole
setprop
setup_fs
sh
showlease
sleep
smd
stagefright
start
Starts the Android runtime.
Code:
stop
Stops the Android runtime.
Code:
surfaceflinger
svc
sync
system_server
tc
testid3
toolbox
top
Shows which processes are currently using the most CPU time.
Code:
umount
uptime
Prints how long your device has been running since it was last booted.
Code:
vdc
vmstat
vold
watchprops
wipe
wpa_cli
wpa_supplicant
$ ls /system/xbin
add-property-tag
btool
check-lost+found
dexdump
dhdutil
hcidump
latencytop
librank
opcontrol
oprofiled
procmem
procrank
rawbu
scp
Secure copy program. (Used to copy files over the network.)
Code:
showmap
showslab
sqlite3
Used to administer SQLite databases.
Code:
strace
System trace command - use to see what system calls a program makes.
Code:
su
Start a shell with root privileges.
Versions of the Android Shell
Android 1.0 used a shell that had no tab completion or history editing.
Android 2.3 added history editing. You can for example use the up/down arrows to edit previous commands.
Other shells
Busybox
Busybox is a program that contains a shell and a set of command line utilities. Search Android Market for "Busybox" and you should find some versions you can install. The Busybox shell includes tab completion and history editing. Some versions of Busybox for Android do not require that you root your phone.
Debian utilities
You can install the full Debian shell and utilities. (Debian is a popular desktop Linux distribution.) I don't know the details, and it may require a "rooted" phone. Try a web search for "Debian Android install".
Custom ROMs
Some custom ROMs come with their own shells and utilities. If you are using a custom ROM, check its documentation to find out what's available.
How can I view stdout outputs in terminal emulator window?
For example with dd command, not specifying output should display it at current terminal, like in linux, but actually doesn't. Any ideas?
Hey wanna troll someone's phone
Type in terminal "stop" lololol
Sent from my E15i using xda premium
Similar to linux terminal commands I use
Nice work though, great guide, thanks dude
W!LßSO @ XDA
Great guide, but you have forgot a very useful command: grep
It allows to apply filters to the output of the commands. The syntax is:
Code:
command | grep filter
For example, to list only the apk files inside a folder:
Code:
ls /folder/to/list | grep .apk
Great guide!
IMO dmesg is also important. Maybe you should add in a description for it?
Dmesg --> prints the Linux kernel output, which is different from the Android system output, logcat. Useful for checking hardware and to see if modules started up succesfully. Also useful for debugging in conjunction with logcat.
Code:
cat /proc/kmsg > /sdcard/dmesg.txt
Copies the dmesg output to a file fled dmesg.txt on the sdcard
And
Code:
cat /dev/log/system > /sdcard/logcat.txt
Copies the logcat output to a file named logcat.txt on your sdcard.
Also, you missed out the parted and e2fsck commands, used for partitioning and checking filesystem integrity.
Also, the command free (display free ram/swap) is not included.
Sent from my E15i using Tapatalk 2
Is there a command for check disk utility as in windows.. chkdsk...
my memory card is not working hence thought of running the check disk if possible...
dspPunk said:
Is there a command for check disk utility as in windows.. chkdsk...
my memory card is not working hence thought of running the check disk if possible...
Click to expand...
Click to collapse
Code:
su
fsck_msdos /dev/block/yourdevice
For ext4 there's e2fsck
scandiun said:
Code:
su
fsck_msdos /dev/block/yourdevice
For ext4 there's e2fsck
Click to expand...
Click to collapse
Dint get it... Sorry i am a so not into commands...
Kindly tell me the step wise solution... How can i see my device [yourdevice] which you have specified...
dspPunk said:
Dint get it... Sorry i am a so not into commands...
Kindly tell me the step wise solution... How can i see my device [yourdevice] which you have specified...
Click to expand...
Click to collapse
I don't have a Xperia X8 actually, does it support mass storage mode for internal sdcard?
http://www.jayceooi.com/2012/03/14/...storage-on-android-4-0-ics-samsung-galaxy-s2/
scandiun said:
I don't have a Xperia X8 actually, does it support mass storage mode for internal sdcard?
http://www.jayceooi.com/2012/03/14/...storage-on-android-4-0-ics-samsung-galaxy-s2/
Click to expand...
Click to collapse
I am having SGS2 and yes it supports mass storage for internal sdcard...
When i connect to my computer it shows only internal sdcard and not external card which is present in the external sdcard slot...
actually the problem is that my sdcard gets detected some times and sometimes it doesnt...
i searched a lot and many of them told that it is a kernel version issue.. i updated kernel still no luck..
then i got one thread which gave me the solution of check disk so was thinking whether terminal emulator has any commands for check disk..
Hi hetunandu, great guide,
but still I don't understand few things:
1: how to run a specific action of an app?
2: how to KNOW the exact sintax of possible actions of an app?
3: is it possible to launch these commands via SSH (through an SSH server)?
eg: I want to start a audio-recording app on my phone from my computer, AND start recording from remote. Is it possible?
Thank you
(and sorry for my english..)
JFI - Never run fsck on a mounted partition.. You will corrupt your data!
CtrlAltDelIrl said:
JFI - Never run fsck on a mounted partition.. You will corrupt your data!
Click to expand...
Click to collapse
Usually fsck won't run on that case and you warn you, you will have to use the force option in that case.
reading traffic stats
I am trying to get the traffic stat getMobileRxBytes (or any other traffic stat) to output a usable result in the terminal emulator. The goal is simply to be able to copy the rx bytes total to be used in Tasker. However, I can't seem to be able to get any output. I would appreciate it if anybody knows the proper command/syntax to show this traffic data. Thanks.
I am on a stock rooted 4.1.1 Galaxy Nexus.
[Q] Is there a command to show some configuration ?
I have run this command on terminal emulator:
[email protected]:/ $ su
[email protected]:/ #setprop net.cdma.rstp.proxy.addr 0.0.0.0;
[email protected]:/ #setprop net.cdma.rstp.proxy.port 0;
[email protected]:/ #setprop net.cdma.httppd.proxy.addr 0.0.0.0;
[email protected]:/ #setprop net.cdma.httppd.proxy.port 0;
Is above command right..???
after that i ran "getprop" i don't see effect of that command.
Can you tell me the right way or command to change my rstp & httppd setting...? cause my Epic4G cannot play video streaming after flashing CM10 nightly.
thanks,
adit
permission denied
china telecom infotmic m7206 not root because no usb i want to root tablet pc
terminal is boot "permission denied" why
help me please ???
Any way to check Camera firmware version per http://forum.xda-developers.com/showthread.php?t=2006128 ?
rooted Verizon SG3 on CM10.0
Hi... Before this I have rooted my phone since yesterday when I accidentally copy su file from "/system" to "/system/bin/" andnow I can't get root access because on Superuser I check the su version was 3.1.1 but there got red words maybe it try saying that I put su file in wrong location and I can't move it back because my root explorer can't get root access and it just show Root Explorer acess denied by Superuser. Terminal emulator also access denied. One more I'm using Sony Ericsson W8 and it can't unlock bootloader. Could someone help me to remove su file from "/system/bin". Thanks You
PutraMasyers97 said:
Hi... Before this I have rooted my phone since yesterday when I accidentally copy su file from "/system" to "/system/bin/" andnow I can't get root access because on Superuser I check the su version was 3.1.1 but there got red words maybe it try saying that I put su file in wrong location and I can't move it back because my root explorer can't get root access and it just show Root Explorer acess denied by Superuser. Terminal emulator also access denied. One more I'm using Sony Ericsson W8 and it can't unlock bootloader. Could someone help me to remove su file from "/system/bin". Thanks You
Click to expand...
Click to collapse
Just root ur W8 again as u did before
see boot animation without rebooting

Categories

Resources