Is there a way for me to run Adb shell as root without typing in
su? I want to be able to have root access without going into the shell.
If I'm understanding your question correctly, you're asking how to get root access automatically when you run
This is controlled by a flag in your boot partition, which most custom ROMs have modified to allow root permission by default. If you get dropped to a
Number 2 is actually not that difficult, but it can be somewhat dangerous if you're careless. There is a wiki article here which explains the process and includes a couple of Perl scripts to help you. These instructions assume a Linux/Unix environment. I have personally used these instructions on Fedora Linux and can tell you that they work, but I do not know about other *nix environments like Macs. I also do not know of any similar Windows instructions, but I could try to track some down if you are on Windows. The exact commands will vary somewhat from phone to phone since different devices use different partition tables.
Generally speaking, though, you need to pull your current boot.img from your phone, unpack it, extract the ramdisk, and find the default.prop file. This is a plaintext file, which you need to open in a text editor and then find the line that contains the value
Alternatively, if you are using a custom ROM but it doesn't have this modification, you can just unzip the ROM and modify the boot.img that is included with it using the above steps. Then you can zip up the ROM with the newly modified boot.img and flash the zip file as you normally would.
This probably goes without saying, but be careful when doing this. Messing with your boot partition can quite easily wreck your phone and force you to recover via HBoot. I would highly recommend testing Fastboot to makes sure you can use extended Fastboot commands and perform a recovery. This varies a bit based on your model, but most phones have some sort of desktop software that can be run to reflash the phone as well.
The third option is that in many cases it may be possible to restart
What are you trying to run as root for? You're saying that you want to run ADB shell with root but you don't want to use ADB shell? Can you clarify?
If the application requests for root access, then the SuperUser application on your phone should handle giving it permission or not. The process in which you rooted your phone should have included a SuperUser application.
As an alternative, you could write your script on the phone and simply have adb execute it, for example:
The script can elevate itself without your intervention (assuming SuperUser is set to remember the approval), for example:
I just did this on my phone with success, the only problem being that I haven't quite figured out how to cleanly end the adb shell session. I have to Ctrl-C in my Windows shell to return to the Windows command prompt -- otherwise adb just sits at the
You can also set the suid bit on your 'sh'. I'm using BusyBox so instructions may not match your setup:
and you should have the root prompt
Well if you phone is rooted you can run commands with the "su -c" command.
Here is an example of a cat command on the build.prop file to get a phones product information.
This invokes root permission and runs the command inside the ' '
Notice the 5 end quotes, that is required that you close ALL your end quotes or you will get an error.
For clarification the format is like this.
Make sure you enter the command EXACTLY the way that you normally would when running it in shell.
Give it a try, hope this helps.
i use for repair home button issue failure
adb shell su -c
adb root shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "INSERT INTO secure (name,value) VALUES ('device_provisioned','1');"