Android Debugging with Logcat and Emulator. Is it possible?
Solution 1
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type
adb logcat
. The log output from the connected device or running emulator will appear. I usually preferadb logcat -v time
to see the time stamps.Type
ddms
. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat
for the emulator and adb -d logcat
for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
Solution 2
If you have setup nbandroid you can find the adb logcat viewer in netbeans under: Window -> Output -> ADB Log
--edit Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
Solution 3
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK. At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.
Related videos on Youtube
aarona
Updated on July 09, 2022Comments
-
aarona almost 2 years
This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
-
Steve Haley about 14 yearsThe process is quite easy using Eclipse, but I don't know whether Eclipse is available for Linux. If it is and you're willing to switch to using it, see this other question for details on how to set up debugging. stackoverflow.com/questions/2552568/…
-
aarona about 14 yearsEclipse IS available for Linux. I might switch... we'll see.
-
-
SHRISH M about 14 yearsJust start ddms from your terminal you should see everything else
-
Nux over 11 yearsNow - at SDK for Android 4.2 - the command for standalone monitor is:
...\android-sdk\tools\monitor
For local instation on Windows the full comand is:%LOCALAPPDATA%\Android\android-sdk\tools\monitor.bat
-
codermonkeyfuel about 7 yearsTo clarify the above comment, the device monitor is meant as a replacement for standalone
ddms
. (runningddms
on the command line displaysThe standalone version of DDMS is deprecated. Please use Android Device Monitor (tools/monitor) instead.
) In Linux, runningmonitor
should be sufficient to run the device monitor. -
Cecil Curry about 2 yearsCaution: DDMS has been officially deprecated (and more recently removed) in Android Studio ≥ 3.0. Use Android Profiler instead.