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 7758909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:29:24+00:00 2026-06-01T13:29:24+00:00

I’ve got a problem which is probably very easy to solve but I can’t

  • 0

I’ve got a problem which is probably very easy to solve but I can’t seem to find the answer.

I’m trying to execute strace on different processes running on an Android device. I’ve succeded in doing this by copying the strace binary to /system/xbin (just like the emulator) and works just fine. My problem is I copied the binary through the bootloader and I don’t want users to have to go through that.

So I found this great tutorial to run binaries from within an app:

http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App

I follow the tutorial and do this:

  • Copy the binary of strace to /data/data/com.mypackage
  • Change execution permissions to the binary (I’ve tryed with 777 too)
  • Try to execute it with

    Process process = Runtime.getRuntime().exec(“/data/data/com.mypackage/strace -p PID -o /sdcard/folder_I_know_it_works”);

I know the command is right because when I execute it from /xbin/system it works perfectly. When I run the one I copied from within my app I get empty outputs. I only get the proper output for my own process, so I understand it’s a permission problem.

I didn’t mention yet that I have root permission on my app of course. I also tryed changing the owner to the strace binary to root:root and system:system and nothing.

To sum up: I need to reach the same permission on a binary I copy from my app to the phone memory than the one I have on a binary found on /xbin/strace

What am I doing wrong?

Another good solution would be finding a way to copy strace to /system/xbin from within an app with root permission. Any ideas?

Thanks a lot in advance!

  • 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-01T13:29:25+00:00Added an answer on June 1, 2026 at 1:29 pm

    Found the answer to this in case it’s useful for anyone else.

    Process process = Runtime.getRuntime().exec("su");
    OutputStream os;
    os = process.getOutputStream();
    os.write("your linux command here".getBytes());
    os.close();
    

    You are basically simply running su as a process and sending commands through its output stream.

    Later you may want to call process.wait()

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into

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.