Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been attempting to root my phone (Samsung Intercept M910, but that probably doesn't matter).

How can I tell that I have actually, successfully gained root? I've run a few apps which require root, and some work and some don't, so I'm unclear if I've gained root or not.

share|improve this question
up vote 25 down vote accepted

Use terminal emulator (a popular free/open-source terminal emulator is Android Terminal Emulator, available from F-droid or Play Market), open the emulator and type

su

you will know with the message that appears after if phone is rooted or not.

Edit:

There is an app just for this now : Root Checker

share|improve this answer
1  
A popular free/open-source terminal emulator is Android Terminal Emulator, available from F-droid or Play Market. – imz -- Ivan Zakharyaschev Apr 20 '13 at 15:20
4  
What if "su: not found"? It simply implies that the su utility has not been installed (or is not in the PATH), rather than whether we have root... – imz -- Ivan Zakharyaschev Apr 20 '13 at 15:52
    
I got "su: not found". But I still suspect the phone is rooted. What can I do now? – Leo Oct 29 '15 at 0:29
    

Connect your phone in developer mode via USB and start an ADB shell

adb shell

If you see a # at the beginning of the line your phone is rooted, if it's a $ try to execute the su command, and if you get a # now, your phone is rooted, but if you get an error that su can't be found it's probably not, or the su binary is simply missing.

There are also apps on the market that test if your phone is rooted.

share|improve this answer
2  
That's not enough. If you see a "$"-Prompt you still can elevate to root via the su binary (typing the "su" command), if you have successfully rooted your phone. – Flow Sep 11 '11 at 10:44
    
Yeah, forgot that some ROMs doesn't have root as default. Hm, anything else you want me to change now? – kyrias Sep 11 '11 at 11:01

There is an application available in the market called Root Checker, that can verify if your phone is rooted, and if you have BusyBox installed.

share|improve this answer
    
Does not that just check for the su binary? – Leo Oct 29 '15 at 0:26
    
That is exactly what it means to be "rooted", is to have su binary installed properly with suid bit set. The su binary commonly comes with an accompaniment program to manage permissions, Superuser app, but this is just for conveniences and ease of use. – Lie Ryan Oct 29 '15 at 0:54
    
Thanks @Lie Ryan, but from some other comments it looks like the phone can still be rooted even if there is no su binary. Is that not correct? – Leo Oct 29 '15 at 0:57
    
Please see this thread for the reason I am asking: android.stackexchange.com/questions/127347/… – Leo Oct 29 '15 at 1:00
1  
@Leo: to be precise, there isn't exactly a different state between rooted and unrooted devices in the underlying Linux system. All Linuxes, including unrooted Android, have setuid system call, which is the primary mechanisms used by Linux programs to acquire elevated privilege. Setting up a suid binary itself requires elevated privilege. Many Android system applications on a unrooted device runs with elevated privilege (e.g. adbd, system updater), but they only escalate for very specific purposes. su is a privileged program that allows you to invoke other programs with elevated privileged. – Lie Ryan Oct 29 '15 at 1:23

You should see the "Superuser" application in the app tray.

Most rooting methods add this app to manage the superuser rights: it appeared for me when I rooted my Desire.

Not all do: so just try to install and run Superuser from the market. If it fails, you aren't rooted :-)

share|improve this answer
    
That's incorrect, the Superuser application has to be installed manually after rooting, but it might be installed automatically if you use a one-click rooting application. – kyrias Sep 11 '11 at 9:40
    
@Demizide: I was updating as you downvoted. It depends how you root it of course: some methods add it automatically like happened for me. – gbn Sep 11 '11 at 9:45
    
Okay, think you could update it again, so that I can undo the downvote? – kyrias Sep 11 '11 at 9:49
    
@Demizide: thank you, done – gbn Sep 11 '11 at 10:03
1  
You can install Superuser on a non-rooted device just fine, though. It just won't do anything without the su binary (and will complain that it needs to "update" it every time you run it). The presence of Superuser doesn't really mean you're rooted; running it kind of does, but the update failure message doesn't say "failed to update because you're not root" or anything of that nature (and you can hit "Cancel" and it goes away). – eldarerathis Sep 11 '11 at 20:48

Use the following commands from RootTools library.

    RootTools.isRootAvailable();

or

    RootTools.RootTools.isAccessGiven();
share|improve this answer
    
Does those calls check if the device really is rooted? Or do they just check for the su binary (as all the root checking apps seems to do)? Is there perhaps any app using these calls? – Leo Oct 29 '15 at 0:43

Beside what everyone mentioned, One super easy way would also be installing an app from Google Play that requires root access. I suggest DroidWall, which is a must-have firewall for android. Install it, and hit apply rules. If not rooted, it will tell you, and will fail to apply rule.

share|improve this answer

Its easy. Just download some famous root requiring apps(apps which require root) eg:- titanium backup, supersu etc. and see that they work or not. If they work correctly, then you have gained root. If they don't work, it means root is not working.

share|improve this answer
2  
If they don't work, that might also have other reasons – such as incompatibilities with your device, bugs in the app. Of course if all of them fail, that might be a strong indicator – but a long way to go. Using a root checker, or a terminal app (as suggested in the linked answers) are much faster and more reliable methods. – Izzy Jan 2 '15 at 11:41
    
Checking root is also a good method but according to question details, some apps had worked and some had not so probably root checker can also fail – Aditya Sinha Jan 2 '15 at 11:51
1  
It's more likely those failed for a different reason: A root-checker, or especially running the su command, has much less complexity, and thus is much less likely to fail. – Izzy Jan 2 '15 at 11:54
    
Yes, you should download root checker basic or pro. – Aditya Sinha Jan 2 '15 at 11:56

For developers and to provide an imho more comprising test via adb do the following:

[you@yourbox]$ adb shell
[root&adbshell]$ mount -o rw,remount /system
[root&adbshell]$ echo $?
 0
[root&adbshell]$
[root&adbshell]$ mount | grep system
 /dev/block/by-name/system /system ext4 rw,seclabel,relatime,data=ordered 0 0
[root&adbshell]$ ls /dev/block/by-name/system -la  
 lrwxrwxrwx root     root              2016-02-23 19:33 system -> /dev/block/nandd
[root&adbshell]$ ls /dev/block/nandd -la 
 brw------- root     root      93,  24 2016-02-23 19:33 nandd

points are that :

  1. Chances are that the adb shell prompt will tell you root@[something] which is clear
  2. but just to check we try remounting /system read-write rw (something that needs root)
  3. checking that the result worked out i.e no error echo $? yields 0
  4. then still checking / following that /system eventually was at a block device /dev/block/nandd in the example that is reported to be accessible only by root

I am aware that this is a "for advanced users only" option, and ad best similar to the other answer suggested by @kyrias, but I think this one is slighly more compatible as mount in contrast to su is more likely to be there.

Also I would like to suggest that a comprehensive test of rootness would involve now to use the root powers and backup the content of the /system and flash it with an alternative system for trial. Else there is a change the adbd is only faking you information, always better to make sure you can test root powers by actually doing something that is visible on multiple channels :)

share|improve this answer
    
You know you can simply do su -c 'id' or execute su followed by id. If you don't see uid=0 gid=0 in the output then the device is completely not or at least not properly rooted. – Firelord Feb 24 at 7:42
    
Look @Firelord su-anything , as you suggest, might be "simpler", but as it was pointed out we cannot assume that su is present an all devices to start with. The solution offer an alternative way and does not seek to be the "simplest way". – humanityANDpeace Feb 24 at 8:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.