有没有办法在 AndroidStudio 中监控线程? [英] Is there a way to monitor threads in AndroidStudio?

查看:55
本文介绍了有没有办法在 AndroidStudio 中监控线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Android Java 应用程序,我正在 AndroidStudio 中创建并在三星平板电脑上运行它(根本不使用虚拟设备).我有三个线程,我相信其中一个线程可能会陷入某种循环,因为应用程序在某些时候会严重减速,但不会永远如此.

是否有一些工具可以让我监控我的应用和所有线程的 CPU、RAM 等使用情况?

谢谢

解决方案

Android 监控工具 替换为 Android Profiler,在 Android Studio 3.0:

<块引用>

Android Profiler - Android Studio 3.0 包含一套全新的工具,可帮助调试应用中的性能问题.我们完全重写了之前的 Android Monitor 工具集,并用 Android Profiler 替换了它们.将应用程序部署到正在运行的设备或模拟器后,单击 Android Profiler 选项卡,您现在可以访问实时 &CPU、内存等的统一视图您的应用程序的网络活动....

要监控线程,请使用 CPU Profiler在 Android Profiler 中.

<块引用>

  1. 点击查看>工具窗口>Android Profiler(您也可以点击工具栏中的Android Profiler).
  2. 从 Android Profiler 工具栏中选择要分析的设备和应用进程.如果您已通过 USB 连接了设备,但未在列表中看到它,请确保您已启用 USB 调试.
  3. 点击 CPU 时间线中的任意位置以打开 CPU Profiler.

I have an Android Java app that I am creating in AndroidStudio and running it on a Samsung Tablet (not using a virtual device at all). I have three threads and I believe that one of them may be getting stuck in some sort of loop because the app severely slows down at some point, but not forever.

Are there some tools available where I can monitor my app and all threads as far as CPU, RAM, etc. usage?

Thanks

解决方案

Android Monitor tools were replaced with Android Profiler, in Android Studio 3.0:

Android Profiler - Android Studio 3.0 includes a brand new suite of tools to help debug performance problems in your app. We completely rewrote the previous set of Android Monitor tools, and replaced them with the Android Profiler. Once you deploy your app to a running device or emulator, click on the Android Profiler tab and you will now have access to a real-time & unified view of the CPU, Memory, & Network activity for your app. ...

To monitor threads, use CPU Profiler in Android Profiler.

  1. Click View > Tool Windows > Android Profiler (you can also click Android Profiler in the toolbar).
  2. Select the device and app process you want to profile from the Android Profiler toolbar. If you've connected a device over USB but don't see it listed, ensure that you have enabled USB debugging.
  3. Click anywhere in the CPU timeline to open the CPU Profiler.

这篇关于有没有办法在 AndroidStudio 中监控线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆