Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7847761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:59:48+00:00 2026-06-02T17:59:48+00:00

while i add this line to my code Process process = Runtime.getRuntime().exec(su -c); or

  • 0

while i add this line to my code

Process process = Runtime.getRuntime().exec("su -c");

or

Process process = Runtime.getRuntime().exec("su");

trying to run the”su” command,

process.exitValue() returns 1 which means fail.

This happens to my one Android device while my the other rooted android device works perfectly with this command. (process.exitValue() returns 0)

Can anyone teach me how to trace the error or how to fix it?

I am confused with this error while my two devices almost in the same condition.

Thanks for your reply in advance.


Hi guys,

Thanks for discussing this issue with me. Your reply hints me a clue that I have removed my old su and place a new su. Luckily enough, the return value is now 0 and I guess it means correct. However, Does any of you might know what is the difference between .exec(“su -c”) and .exec(“su”)? Please let me know if you know the difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:59:49+00:00Added an answer on June 2, 2026 at 5:59 pm

    I suspect you lack Superuser on the problematic phone, do you?
    Or at least something about Superuser could be wrong (versions, binaries…)

    su calls Superuser which allows root access or not.

    Many problems seems to occurs on latest versions of Superuser.

    Try to remove it and install other version:

    http://goo.im/superuser

    Another note: if you’re trying to gain root access or to execute commands as root, you should not only use exec("su"). Take a look at the RootTools a library by stericson himself 😉

    http://code.google.com/p/roottools/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered this problem (while trying to add SQL Server Database (.mdf) file to
I need to run Maven from the command line while Eclipse is open. Since
I've been stuck for a while trying to add tags to posts. I'm using
I'm trying to work out what's going on with this code. I have two
I'm trying to debug why I get this error: Error occurred while sending a
I have a {Red,Blue,Green,Yellow} returned as string. How to process this to add to
This line of code confuses me: List<string> keys = new List<string>(); IDictionaryEnumerator ca =
I have problem on my blog: http://osify.com while processing add new post with above
I want to know how to add images while exporting the image from highcharts.
while( inStream.hasNextLine() ) { ... lineList.add( inStream.nextLine() ); } ... lineList is an ArrayList.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.