I'd like to check for memory leaks in my Android app using the DDMS feature in Eclipse. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.
However, when I connect my Droid to the PC, the device shows up just fine in DDMS. The logcat is generated correctly, and I can view the file structure. However, threads do not display. I get "no client selected" in the Threads pane, and there is no drop-down icon next to the device listing.
Do I need to change some particular setting in Eclipse? Is this maybe a driver issue?
Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default
Add Android Device view to get device pan(e) noted above
Set android:debuggable=true (two g's) in app tag as noted above
Run your app in emulator
Select device in device pane
Click the update threads button
Enjoy
Make sure you have android:debuggable="true" in you application tag in the manifest file
This is expected behavior. The issue is your droid is not in debug mode. Notice that in the Devices pane, beside the version number, debug is stated against the emulated device but not in the case of the droid.
From what I have found so far - on the droid, only an app can be run in debug mode; and only this will be listed under your device in DDMS.
I don't know how to run(/boot) the entire droid in debug mode, or if it is possible. So far as it appears, there is no way to boot an entire real device in 'debug' more.
Go to DDMS
Select device in device pan
Look at header of this pane. You can see update threads
You can see thread and updates from device
If you use Intellij Idea like me - run monitor from tools-> android, other way Idea built in ADB conflict with ddms.
On Android Studio :
On the DDMS (Dalvik Debug Monitor Server) Screen:
Show View -> and then select the profiling view you need.
Related
I'm attempting to use the DDMS debugger to connect to a process on a Nexus4 device. I've built a debug version of the application, added android:debuggable="true" to the manifest and also added android.os.Debug.waitForDebugger(); to main MainActivity.
However the debug icon in DDMS remains greyed out, even though I can see the device and the application the DDMS list.
Any suggestions on how to resolve this?
How to use Monitor (DDMS) tool to debug application step by step?
check this post you will get the answer.
In App Toolbar you will find "Android Device Monitor" just right beside the "SDK Manager". Click on this your DDMS will run.
but
Problems:
1. It will close any adb connection and any debugging process.
2. Unfortunately You will not be able to put debugger on any selected process. even this is a very good way of debugging your application.
Don't know why Google/InteliJ/Studio Developers are not fixing this issue.
I am facing a problem with the DDMS in Eclipse (Eclipse + ADT) in order to debug my Android application directly on my device.
In the DDMS devices tab, I am able to see my device :
Name of my device (Samsung S5...).
Status ONLINE
Version of the device (here 4.4.2).
Only screenshot options and capture trace are available :
I have tried to use the android::debuggable="true" in my application but it is not working.
I have tried with another device (Nexus 5) and there is no difference...
Any ideas or tips to solve my problem ?
Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default
Add Android Device view to get device pan(e) noted above
Set android:debuggable=true (two g's) in app tag as noted above
Run your app in emulator
Select device in device pane
Click the update threads button
Enjoy
My Device shows up on the Android Device Chooser as:
Serial Number -- Ige-vm670-A0000028F1773B
AVD NAME -- N/A
Target -- 2.2.1 (with a green check mark next to it!)
State -- Online
Everything seems fine..So, I press the "OK" button on the bottom right hand corner of the Device Chooser screen. When I do this the Device Chooser closes and the Launching bar in eclipse eventually finishes, but then the application never starts on my phone!! :(. Am I missing something? I tried using different USB cables, switching from USB 3.0, and checking if there is enough memory on my phone but nothing seems to work :(. PLease help this newbie!! I'd much appriciate it!! ALso, i'm running eclipse in windows 8.
following steps may help you
1)Restart your Device
2)Go to application settings and enable the USB debugging.
3)also enable other application to run on your device.
4)make sure that device status is online on android device chooser.
5)make sure that your device appear in device list in android Eclipse.
If above steps wont help you then try to run your project on emualator.And if emulator fails to launch your project then you need to see the android console
Enabling SD-Card access may result failure of connecting to the device.
Please try to switch MTP on instead of either PTP or SD-Card
i m starting (or at least trying to) developing android application(s) and I m using eclipse for it along the android sdk.
Now I m wondering if there's a faster way to "test" and tryout something newly writen in the code than starting it in the emulator?
I'm wondering because I m running on 8gb ram and q9550 (quadcore) and it takes some time (let's say 20secs) to upload and start the apk and now
I'm wondering if this really is the only way to test since it requires huge amount of time, especially when I'm trying something new which doesn't work and thus I'm always gotta run it like this let's say like 20 times until I figure out what's wrong with my code...
You can connect your android phone using USB debugging mode and debug your code. If you can't do that, you can export an apk file (which is quick) and use dropbox/gmail to send it to your phone. I am not a big fan of emulator :)
Here's how to enable usb debugging
http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/
I would recommend running on your device rather than the emulator.
http://developer.android.com/tools/device.html
In short:
Turn on "USB Debugging" on your device.
On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).
Set up your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Ubuntu Linux, there is a detailed guide in the link above.
Now in eclipse, your device should be available to run on.
In the eclipse toolkit, you have the option to run it directly on a device. It's rather quick to do so.
Enable USB debugging as well as installation of apk from sources other than the market. Then assuming you have already setup the required drivers/settings to connect to your phone via ADB, you should be able to run it on the device and debug. In the run dialog, it will list all available devices and you can simply select the one you want to use.
If you already have a run entry (i.e. you've already run your application),
select your project
click Run -> Run Configuration
You should be in your application run configuration (on the left under Android Application -> Your_App).
In the Target tab, you should be able to select your device. It will likely already be in "Automatically pick compatible device...". On my setup, it will run directly on my phone if it's the only available device. You can select Always prompt to pick device which will let you choose every time.
Eclipse plugin (ADT) information: http://developer.android.com/tools/help/adt.html
Information about setting up your device: http://developer.android.com/tools/device.html
I know android emulator is too slow.
You can either use device or
try bluestacks it saves lots of time.
User device only when you want to test your app for particular device.
Here is what you are looking for :
http://developer.android.com/tools/device.html
To summarize:
Plug your phone to your computer with a USB cable.
Make sure the drivers are installed and your phone properly connected.
Make a Ctrl + F11 from eclipse.
It will build the apk, transfer it to your phone and then launch it automatically.
If you have unit tests, Robolectric lets you run them without using the emulator or the device.
you can download bluestacks as emulator, as it is really fast.
after then make settings in eclipse as window->preferences->android->build -> then uncheck the 3rd checkbox written as "skip packaging and...", then apply and restart the eclipse to take effect.
now open the bluestacks in background and just double click the apk file in bin folder of eclipse and bluestack will install it in 2 to 3 secs and you can directly see the result.
NOTE here that you have to only save the file ,you working on in eclipse and only double click on apk, and result will directly appears to bluestacks. Without uninstalling and reinstalling apk in bluestacks.
and you can delete your apk also, it automatically immediately create
a fresh version of apk (thus not required) as soon as you save all your files apk will be updated.
Google BlueStacks.
It runs on Windows and it's really fast.
I'm developing on a Samsung Galaxy S II using eclipse and the eclipse android plugin. This is not the first time I'm using DDMS on this computer or phone and everything used to work just fine.
Now, when I connect the device, DDMS shows it on the device list, LogCat shows output, I can even browse the file system, but clicking on the device does not show its process list.
I have tried restarting my computer, restarting the phone, turning debug mode off and on again, connecting it to another computer, checking the cable by connecting another device, all to no avail.
Any ideas?
Only a particular app being 'debugged' will show under a physical device.
Since unlike the emulator - an actual device does not run in debug mode.
If the app you wish to debug is not listed then make sure that it is:
a debug build
running on the device
Reference: https://stackoverflow.com/a/27111467/483588
Settings -> Application -> Development -> USB Debug: set ON , Stay awake: set ON
Replace other USB cables
Install Samsung ADB device interface for development (Composite ADB Interface)
Well, that's all I know.
For whom ever gets here, I solved the problem doing what #Fenix Voltres said above, and changed the AndroidManifest flag to android:debuggable="true".
if you have 2 instances of eclipse open this could cause the problem.
close the other instances and try again.