有没有一种方法可以监视AndroidStudio中的线程? [英] Is there a way to monitor threads in AndroidStudio?

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

问题描述

我有一个要在AndroidStudio中创建并在Samsung Tablet上运行它的Android Java应用程序(根本不使用虚拟设备).我有三个线程,我相信其中一个线程可能会陷入某种循环,因为该应用程序在某个时候会严重降低速度,但不会永远变慢.

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.

是否有一些可用的工具可以监控我的应用程序以及所有线程,包括CPU,RAM等的使用情况?

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

谢谢

推荐答案

Android监控器工具 Android Profiler 替换="https://android-developers.googleblog.com/2017/10/android-studio-30.html" rel ="noreferrer"> Android Studio 3.0 :

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

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. ...

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

To monitor threads, use CPU Profiler in Android Profiler.

  1. 点击查看>工具窗口> Android Profiler (您也可以点击工具栏中的 Android Profiler ).
  2. 从Android Profiler工具栏中选择要配置的设备和应用进程.如果您已通过USB连接设备,但未在其中列出设备,请确保已启用USB调试.
  3. CPU 时间轴上的任意位置单击以打开CPU 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天全站免登陆