ddms

Android性能优化工具之TraceView

风流意气都作罢 提交于 2019-11-30 17:38:51
Android性能优化工具之TraceView 引子 TraceView是Android平台特有的数据采集和分析工具,该工具可以通过图形化的方式让我们了解需要跟照片那个程序的性能,可以具体到method,主要用于分析Android中应用程序的Hotspot。该工具本身是一个数据分析工具,那个如何获取数据并分析呢,笔者用之前写的一个demo.apk来进行说明分析。 采集数据 采集数据也就是生成我们需要分析的trace文件,生成该文件有三种方式 使用代码 使用Android Studio 使用DDMS工具 代码方式生成trace文件 使用代码生成traces文件主要利用Android系统的Debug这个api,该类在android.os包下,示例代码如下 //开始 trace,默认保存文件到 "/sdcard/filename.trace" Debug.startMethodTracing(String fileName); /*需要分析的代码..*/ Debug.stopMethodTracing(); 简单说明一下,当调用开始trace代码的时,系统会产生 trace 文件,并且产生追踪的数据,当调用结束trace代码时,会将追踪的数据写入到 trace文件中。既然文件保存在sdcard根目录,我们可以copy出来,也可以通过adb 将其pull 出来 使用Android

Android DDMS如何使用?

安稳与你 提交于 2019-11-30 17:38:41
DDMS 的全称是Dalvik Debug Monitor Service,它为我们提供例如:为测试设备截屏,针对特定的进程查看正在运行的线程以及堆信息、Logcat、广播状态信息、模拟电话呼叫、接收 SMS、虚拟地理坐标等等。 如何启动 DDMS DDMS 工具存放在SDK – tools/路径下,启动DDMS方法如下: 直接双击ddms.bat运行; 在Eclipes调试程序的过程中启动DDMS,在Eclipes中的界面如下: 选择“Other”,界面如下: 双击DDMS就可以启动了。 DDMS对Emulator和外接测试机有同等效用。如果系统检测到它们(VM)同时运行,那么DDMS将会默认指向 Emulator。以上2种启动后的操作有些不一样,建议分别尝试下。 DDMS 的工作原理 DDMS将搭建起IDE与测试终端(Emulator 或者connected device)的链接,它们应用各自独立的端口监听调试器的信息,DDMS可以实时监测到测试终端的连接情况。当有新的测试终端连接后,DDMS将捕捉到 终端的ID,并通过adb建立调试器,从而实现发送指令到测试终端的目的。 DDMS监听第一个终端App进程的端口为8600,APP进程将分配8601,如果有更多终端或者更多APP进程将按照这个顺序依次类推。DDMS通过 8700端口(”base port”)接收所有终端的指令。

Android Studio and android device monitor

别说谁变了你拦得住时间么 提交于 2019-11-30 15:18:28
I just switched from Eclipse to Android Studio. For what I saw since now the new IDE has a lot more features than Eclipse, and I like using the new IDE for my app development work. I just can't understand one thing: in Eclipse, there is the very useful DDMS perspective , from where you read Logcat and do a lot of other things, like using the very useful dump view hierarchy function, which allows you to take a dump of the UI and inspect it to understand what is shown where in your layout. I'm not seeing nothing similar in Android Studio, and after making a lot of research it seem that the only

Logcat cannot detect app or package names

前提是你 提交于 2019-11-30 11:51:46
问题 I'm using Android Studio (Beta) 0.8.7 and my logcat has been working fine for months. All of a sudden my logcat is unable to detect any app or package names. This means I cannot filter the messages for the particular app I'm testing which is very annoying. Typical logcat messages now look like this: Notice the question mark (?) where the app/package name should be... Originally I thought it was my device but I've tried it with another android device that I own and I get the same issue. This

Eclipse Hangs in DDMS post-create init

时光毁灭记忆、已成空白 提交于 2019-11-30 10:48:42
From last two days, eclipse started showing wired behaviour. Its goes in infinte process of DDMS post-create init, And if i try to run the application then Eclipse got hanged. I have tried to install from scratch with eclipse 6.2 and eclipse 7.0, but No luck. Is anybody else facing this problem, and got any solution then please share with me. I had this problem, it was due to the presence of the file .lock in the .metadata folder of my workspace. I don't know if this is your problem, but closing eclipse and deleting the .metadata\.lock file from your workspace, worked for me. I was having the

Can't access data folder in the File Explorer of DDMS using a Nexus One!

安稳与你 提交于 2019-11-30 06:48:00
I have my Nexus One connected with the USB. When I visit the File Explorer of the DDMS, if I click on the "data" folder the little plus near the name "data" disappear for 2-6 seconds and then reappear but the contenct of the folder "data" is not showed! Here some other information: the folder data has permissions drwxrwx--x the OS of my PC is Windows XP Eclipse v. 3.5.2 Android SDK 1.6 If the adbd daemon is running as root, you can browse /data using adb-based tools such as the DDMS file explorer or the adb shell. If it's not, you can access a few files under /data and its children directly by

Android DDMS - send calls to actual device

主宰稳场 提交于 2019-11-30 05:21:50
问题 Does anyone know how (or if it's possible) to simulate a call to an actual device (i.e. USB debugging) using the DDMS in eclipse? I have no problems simulating calls to the emulator and the app I'm writing runs fine in both the emulator or the device. Platforms: IDE: eclipse on a mac Android Device: droid incredible, usb debugging enabled other: <application android:debuggable="true"> figured out you can't call an actual device from the emulator. 回答1: In the DDMS view, you have a tab called

Eclipse Android: Could not open Selected VM debug port (8700) [duplicate]

為{幸葍}努か 提交于 2019-11-30 03:12:11
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Could not open Selected VM debug port (8700) I am getting this error on the console when opening Eclipse : "Could not open Selected VM debug port (8700). Make sure you do not have >another instance of DDMS or of the eclipse plugin running. If it's being >used by something else, choose a new port number in the preferences." pretty sure DDMS is the Andoid debugger, and I am also pretty sure it is not turned on.

Logcat cannot detect app or package names

拜拜、爱过 提交于 2019-11-30 01:24:13
I'm using Android Studio (Beta) 0.8.7 and my logcat has been working fine for months. All of a sudden my logcat is unable to detect any app or package names. This means I cannot filter the messages for the particular app I'm testing which is very annoying. Typical logcat messages now look like this: Notice the question mark (?) where the app/package name should be... Originally I thought it was my device but I've tried it with another android device that I own and I get the same issue. This is what I've tried: Restarting Android Studio and my computer Killing and starting the ADB server from

Android Studio and android device monitor

谁都会走 提交于 2019-11-29 21:26:21
问题 I just switched from Eclipse to Android Studio. For what I saw since now the new IDE has a lot more features than Eclipse, and I like using the new IDE for my app development work. I just can't understand one thing: in Eclipse, there is the very useful DDMS perspective , from where you read Logcat and do a lot of other things, like using the very useful dump view hierarchy function, which allows you to take a dump of the UI and inspect it to understand what is shown where in your layout. I'm