简体   繁体   English

如果其他应用程序在设备上崩溃,则会侦听Android App

[英]Android App that listens if other apps crash on device

Is it possible to have an App that works in the background and listens to when another app crashes on my device? 是否有可能在后台运行的应用程序,并在我的设备上另一个应用程序崩溃时收听?
I want my app to notify my computer when it detects that the app I'm using on my device crashed or stopped. 我希望我的应用程序在检测到我在设备上使用的应用程序崩溃或停止时通知我的计算机。 If so would what it need to listen too? 如果是这样,它还需要听吗?

A very hacky way would be to write a native binary which monitored Logcat, upload the executable to your device using ADB and launch it using the shell account. 一种非常hacky的方法是编写一个监控Logcat的本机二进制文件,使用ADB将可执行文件上传到您的设备并使用shell帐户启动它。 Note that this is not an App though. 请注意,这不是一个应用程序。

The Android shell user has enough privileges to view Logcat for all processes and perform network operations, so you could just scan Logcat for the tell-tale messages that indicate that an app has crashed, siphon out the stacktrace from Logcat and then send it over the local network to your PC. Android shell用户具有足够的权限来查看所有进程的Logcat并执行网络操作,因此您只需扫描Logcat以获取指示应用程序已崩溃的告警消息,从Logcat中吸取堆栈跟踪,然后通过本地网络到您的PC。

This actually sounds like quite a cool idea. 这实际上听起来很酷。 Might have a go at it building it myself :-) 可能会自己建立它:-)

I think you want to create Samsung's Smart App Manager . 我想你想创建三星的智能应用管理器 That track the crashes of all application and show notification to uninstall app or remove. 跟踪所有应用程序的崩溃并显示通知以卸载应用程序或删除。

From Android doc : By default, the system assigns each app a unique Linux user ID (the ID is used only by the system and is unknown to the app). 来自Android doc:默认情况下,系统会为每个应用分配一个唯一的Linux用户ID(该ID仅由系统使用,并且应用程序未知)。 The system sets permissions for all the files in an app so that only the user ID assigned to that app can access them. 系统为应用中的所有文件设置权限,以便只有分配给该应用的用户ID才能访问它们。

Each process has its own virtual machine (VM), so an app's code runs in isolation from other apps. 每个进程都有自己的虚拟机(VM),因此应用程序的代码与其他应用程序隔离运行。

By default, every app runs in its own Linux process. 默认情况下,每个应用程序都在自己的Linux进程中运行。 Android starts the process when any of the app's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other apps. 当需要执行任何应用程序的组件时,Android会启动该过程,然后在不再需要该过程时或系统必须为其他应用程序恢复内存时关闭该过程。

Each and every android application runs in isolation from other apps. 每个Android应用程序都与其他应用程序隔离运行。 So any app can't track the crash log of other app. 因此,任何应用都无法跟踪其他应用的崩溃日志。

The question is : How Samsung's Smart App Manager is doing. 问题是:三星的智能应用管理器是如何做的。

I think samsung smart app only works with Samsungs devices. 我认为三星智能应用程序仅适用于三星设备。 Root Permission is required to perform such type of action. 执行此类操作需要Root Permission。 Samsung's Smart App only have root permission in Samsung's devices. 三星的Smart App仅在三星的设备上拥有root权限。

If you are developing app for custom ROM or Rooted android device then you can otherwise you can't do. 如果您正在为自定义ROM或Root的Android设备开发应用程序,那么您可以做其他事情。

当您在Android开发者控制台中上传apk时,您有任何选项,包括错误选项,然后当应用程序在某些设备中崩溃时,他们可以发送报告,您可以在de console中看到它...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM