amcommunity / TipsAndTricks

Tips and tricks on App Manager
15 stars 1 forks source link

Filtering logs by app in the log viewer? #5

Open MuntashirAkon opened 1 year ago

MuntashirAkon commented 1 year ago

The logging system in Android (logd) logs everything using process ID (PID). Unlike the package name of an app, a new PID is created everytime you relaunch the app. This is problematic because to actually filter logs by the app, you need to know the current PID of the app, and to know the current PID of the app, you have, at first, to launch it. The dilemma does not end here. A few apps are also capable of running in more than one processes. For example, Chromium browsers run services in multiple processes to ensure proper sandboxing. Therefore, for these apps, you’d need to know all the PID of all the processes that were created.

Fortunately, App Manager is equipped with necessary features to help you figure the PIDs of an app. This could be done in several ways such as finding it in the Running Apps page, clicking on the running tag in App Info tab or using Log Viewer itself. However, to find the PIDs of a particular app or filter by a PID in Log Viewer, utilising the features in Running Apps is the best option. In the future, App Manager will also support filtering by package names which will automate this finding process.