Before I was very fond of using the real machine for debugging, because at that time I think it is easier to debug with the real machine, until I found that my phone does not print LOG.D () debug log, I began to use the simulator frequently. Of course there are two small points: my phone does not support fast start and small computer configuration is relatively low, the simulator too eat memory.
Write a simple application whose code is
Public class extends appcompatactivity { @Override protectedvoid onCreate (Bundle Savedinstancestate) { super. OnCreate (savedinstancestate); Setcontentview (r.layout.activity_main); LOG.D ("Debug Log", "Hello"); LOG.E ("error log", "Hello");
It is simple to output a debug log and error log, but the output from the real machine and the emulator is different.
The first thing to use is a real machine.
Its output log has only the error log and the debug log is missing.
Then we use the simulator to debug
It's got all the logs out.
We are very mad when we are debugging an application, but if every log is to be output. Through the Internet to know that some manufacturers are relatively low-level log ban output, so you do not see just the debug log.
Speaking of which, I have a lot of nagging, I recommend the debug log finally use the method of log output, because log is hierarchical, there are filters, which greatly facilitates our capture of the output log, try not to use the system. out. println () and system. err. println ()
Android Debug LOG.D () No output