title: List of All running processes in Android
body: <p>How to get the list of Android system's All running process including System launched processes?</p>
  <p>I tried to get the list using below code:</p>
  <pre><code>ActivityManager activityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
  List&lt;RunningAppProcessInfo&gt; procInfos = activityManager.getRunningAppProcesses();
  </code></pre>
  <p>This gave me the List of processes such as <code>com.android.phone</code>, <code>com.android.chrome</code>, etc.</p>
  <p>But when I run a <code>ps</code> command in my <code>adb shell</code>, I could see whole other bunch of processes running. I am attaching the screenshot of all those processes running in my system.
  <img src="https://i.stack.imgur.com/jpWLO.png" alt="Running processes in my devices" /></p>
  <p>As one can see, there are several Android System's processes are also running like <code>/system/bin/vold</code> and <code>/system/bin/installed</code>, etc.</p>
  <p>However, these are not reported by <code>getRunningAppProcesses()</code> API. In its docs, it says that this API:</p>
  <blockquote>
  <p><strong>Returns a list of application processes that are running on the device.</strong></p>
  </blockquote>
  <p>Does this mean it won't return &quot;system process&quot;? And if that is the case what option developer can have to iterate over &quot;ALL&quot; process running on Android?</p>
  <p>-- <strong>What else I tried:</strong>
  Tried with 2 more APIs from <code>ActivityManager</code>:</p>
  <ol>
  <li><code>getRecentTasks(int maxNum)</code> and it's variant.</li>
  </ol>
  <p>But Android docs warns about its use as below:</p>
  <blockquote>
  <p><strong>This method was deprecated in API level 21.</strong></p>
  <p><strong>As of LOLLIPOP, this method is no longer available to third party applications</strong></p>
  </blockquote>
  <ol start="2">
  <li><code>getRunningServices(int maxNum)</code></li>
  </ol>
  <p>But both of these could not give me names like <code>/system/bin/debuggerd</code>, etc.</p>
  <p><strong>NOTE: I am running Android-4.2 Jellybean, on Non-Rooted device.</strong></p>