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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:53:02+00:00 2026-06-13T05:53:02+00:00

I have Android application that on Service start implement followed code: … Process process

  • 0

I have Android application that on Service start implement followed code:

...
Process process = Runtime.getRuntime().exec("logcat -v time -s " + arg);
BufferedReader bufferedReader = new BufferedReader(
                new InputStreamReader(process.getInputStream()));
...

As you see I start logcat process to listen on logs.
Unfortunately, the stop service doesn’t stop logcat and after several launches i get:

app_125   4782  144   137124 30584 ffffffff 00000000 S com.wefi.agnt.ui
app_125   4796  4782  1028   592   ffffffff 00000000 S logcat
app_125   4839  4782  1076   640   ffffffff 00000000 S logcat
app_125   4842  4782  952    516   ffffffff 00000000 S logcat
app_125   4845  4782  896    460   ffffffff 00000000 S logcat
app_125   4848  4782  900    464   ffffffff 00000000 S logcat
app_125   4851  4782  876    440   ffffffff 00000000 S logcat
shell     4852  171   788    336   c00cc7e4 afd0c78c S /system/bin/sh
shell     4853  4852  944    332   00000000 afd0b83c R ps
app_123   11189 144   114484 18908 ffffffff 00000000 S com.mspot.android.moviesClub.att  

… list of logcat processes. How can I kill them?

Any ideas

  • 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-13T05:53:03+00:00Added an answer on June 13, 2026 at 5:53 am

    Since you have a handle on the Process instance, you should be able to use process.destroy() when you stop your service. The Logcat processes are running independently of your app, so they will continue running after your app’s Service stops running unless you terminate them.

    If you just want to clean up the processes on your device while testing the app, you can run adb shell to get a shell prompt on the device, and then use kill <PID> to terminate a process.

    EDIT:

    The Process documentation also specifies that you should use ProcessBuilder to set up and run the process:

    ProcessBuilder pb = new ProcessBuilder("logcat", "-v", "time", "-s", arg);
    pb.redirectErrorStream(true);
    Process process = pb.start();
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web Service and an Android application that uses this web service.
I need to have ALWAYS a background service that will synchronize my Android application
I have an Android application that has a service that runs in the background,
I have an Android application. In one activity I start a service like this:
I have an android application that launches a child Activity under certain situations. Both
I have an Android application that connects to Facebook to request authorization of an
I have an Android application that uses the Android database to create tables and
I have an android application that displays a toast every hour and then every
I have an android application that requres a login based on users in a
I have an android application that has 3 activites. For the 1st and 2nd

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.