I'm working on android . it seem's that some times my LogCat doesn't work correctly and do not any thing mean that it don't show any thing . (specialy when i working on more than one emulator .) can any one help me ?I need my LogCat .
Usually it happens when eclipse loses the connection to the adb server. The cause is often testing on more devices/emulators.
In order to fix this, open the DDMS perspective and in the Devices View click on the device for which you want to output the logs in LogCat and they will appear again.
In Eclipse:
Window > Open Perspective > DDMS, then
click on the device in the "Devices" view
Or if you do not want to switch perspectives
Window > Show View > Other
select -> Android > Devices
Might be an filtering issue in eclipse...clear filters and set mode to verbose!
A few items to try:
Make sure your USB Debugging is enabled.
Make sure you have the right drivers for your phone installed - you can usually get them from the manufacturer's website. These are not always the same as the drivers installed by Windows for media sharing. This site will help for finding OEM USB drivers.
Close the LogCat window. Connect your device. Make sure USB debugging is enabled. Re-open LogCat.
Make sure you're in the right view in LogCat. You may be in an app filter view and not the un-filtered view.
Restart Eclipse and try any of #1 - #4.
Good luck!
Related
i am new in android app testing. i need to find the heap size and heap uses for a app. so i am doing this by using DDMS but there is a problem that, its not showing the running process of device.
Device .Nexus 6.0.1. Can you tell me please What am I missing here??
any help would be appreciated.
See circle in the screenshot where the device is appear but its process not displayed
I just solved the problem.
If you only want to show the information of your app, adding android:debuggable="true" in the corresponding Manifest.xml.
Otherwise, rooting the device and flashing a customized boot.img with "ro.debuggable" set to 1.
Why? Check out:
ro.debuggable
There are 3 possibilities:
Try to change another usb cable.
There are many cables only for charge, not for data connection. buy a cable with data connection maybe solve your problem.
Enable developer option
Go to the settings menu, and scroll down to "About phone." Tap it.
Scroll down to the bottom again, where you see "Build number." Tap it seven (7) times.
After the third tap, you'll see a playful dialog that says you're four taps away from being a developer.
Keep on tapping, you've got the developer settings back.
You dive into that menu to do things like enable USB debugging
Restart adb
adb kill-server
adb start-server
Here you can find step by step process for find the heap size.
Heap Viewer Walkthrough
Hope this will help you..
I have two android devices connected to the same station. I would like to view the logcat for both while running them in debug mode in eclipse.
I have had SOME luck with the following steps:
Run the app on Device 1
Run the app on Device 2
Open a new window (window/new)
In the new window, open view logcat
About 40% of the time this results in in each eclipse window showing data from a different phone... but not always. It seems to be almost a luck-of-the-draw kind of thing. More often than not both windows show the same device. If I open device viewer and select a device in either window both change.
How can I do this all the time?
This is a very late reply but probably you didn't find a solution.
Solution:
Click Window ---> Show View ---> Other ---> Android ---> Devices.
Simply click on a device to switch to its logcat.
You can try to use adb in two different console windows to get the logcat for each one.
Example:
in console window 1: adb -s <device01_serial> logcat
in console window 2: adb -s <device02_serial> logcat
As takecare said.
This is how you can do it:
Find the device id's of Device 1 and Device 2. Do this by opening a shell prompt and typing the command
adb devices
You'll get a list of connected devices and their id's.
Run the command
adb -s [device_1_id] logcat
Where [device_1_id] is the device id of your Device 1 which you obtained in the first step.
Open another shell and do the same as in step 2, but for you Device 2.
I don't believe there's a good way to do this. You can approximate it though. One option is (as other answers have suggested) to use logcat from adb. This obviously isn't as pretty. Another is to run DDMS directly (instead of through Eclipse) for your second window. This gets you pretty close and gives you two logcat windows each with their own device selectors. The DDMS executable is found in the tools folder of your Android installation.
Here's the way I handle switching between device's logcat output using Juno M20120914-1800.
Unfortunately it is not automatic, but it is at least the most reliable way I've found yet, and once you get used to doing it, it's not that bad.
I click on the device icon in the toolbar.
I click on the device name.
Then I click on logcat again and it will show the device I selected.
It seems like this should be a feature, to be able to monitor more than one device/AVD at a time.
When I try to debug using one of the configurations that I've set up (for example Android233), the emulator never actually launches. I just see a little green icon in my task bar that says "launching Android233," but it never launches. I've let it sit there for hours and it never does anything. I don't know if this is related, but my emulators don't show in device view in the DDMS perspective. I have a physical Android device, which shows up in device view. My question is, what is happenin' and how can I fix it?
Thanks for taking the time to read my question :)
I thought I had the problem figured out, but it stopped working again. Here's more information: When I run my debug configuration, in the lower right corner of my Ecplipse windows it says:
"Launching MyDebugConfig (100%)" and then there's a green icon next to it.
I looked in task manager and the emulator is not in there. I looked in DDMS and my AVD is not listed and there is nothing in the LogCat or Thread or anything else for that matter. I have my debug configuration set to prompt me to pick a device, but it never does that. It just loads my AVD, even if I have my phone connected (which is visible in DDMS). I'm so stumped. I've had this problem since I started using Eclipse and I don't know what to do.
Thanks.
Go to DDMS Perspective =>Click View menu=>reset adb
If Your genymotion virtual device is not seen in android device monitor then just try this.
1. start android studio
2. start Android Device Monitor
3. Lastly start the genymotion virtual device it will appear
The emulator won't show up in the DDMS section until its running.
The emulator won't lunch probably because you misconfigured it, currently the lunch dialog of the emulator doesn't support error messages, however you can get the lunch stack trace while you try to lunch the emulator via Eclipse.
Disconnect your physical device, run your project and select the emulator. you should see an error message on DDMS console.
If you in Windows try run (after starting emulator)
adb.exe kill-server
adb.exe start-server
and wait for restarting your adb
I am a newbie to Android and the Eclipse development environment and would like some advice on best practices for debugging my apps when they throw a Force Close.
I have researched ADB, however, I can not get this to interact with my phone even though I have explicitly turned debug mode to true on my test handset.
Obviously Android comes with a LOG method which I have seen utilized in many example apps, can someone please explain how to review these logs quickly and how to setup logging appropriately to determine the cause of a Force Close (always occurs when I push the Home button).
Any advice on debugging effectively in Eclipse would be much appreciated!
Sincerely,
Ryan
To debug using your device, you will need to have debug mode turned on (which it sounds like you do), you will then need to have the phone plugged in with the USB connector. From here, you can tell Eclipse to run/debug.
Eclipse should ask which device to use (this is done because there should be multiple devices available for running/debugging since your device is plugged in). At this point, you can select your actual device from the list, and you should be up and running.
If you are using android.util.Log, then your logs will show up in LogCat. If you do not see LogCat by default in your Eclipse environment, you can add it by doing the following:
Go to Window -> Show View -> Other
Select Android -> LogCat
Cick OK.
When running/debugging your device, you should see your Log statments in LogCat.
As I have never been able to get Eclipse to refresh the LogCat when I'm debugging on device, I will add this :
You can also debug from command line like this :
"adb -d logcat"
However, as the windows command line is awfully basic, the line are cut in 2 most of the time.
And my asking about your OS does help because the procedure is not the same to set up device debugging if you are on windows or linux or mac.
For instance, in the case of windows, you need to install a driver (you can find all the doc here) before being able to debug on a device.
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.