问题描述
在我使用的是Android模拟器我可以做亚行logcat看到输出消息(日志/的System.out.println)起源于我的code。它也显示了执行过程中发生的异常的堆栈跟踪。
但是,当我使用的是真正的手机,亚行logcat不做/显示任何东西。
我也试过亚行-d logcat的,这也不会显示任何内容。
有没有办法得到它与真正的手机正常工作?
感谢。
更新:
我只是想亚行-s?logcat的(?是设备的序列号),也没有得到结果。
我尝试另一种亚行命令,看看什么是工作:亚行-s错误报告。这印了很多东西。例如:内存信息,CPU信息和一些Java具体的事情。因此,接缝有些东西是工作。
-
启用USB调试到设备中。
-
连接设备到电脑
-
使用此命令
- > $ ADB设备(可以提供设备ID已连接) 输出前。 82990AB830201D设备
- > $ ADB -s设备IDlogcat的(你可以看到你的设备的logcat)
前$ ADB -s 82990AB830201D的logcat
我按照这个步骤,它的作品不错。
when I'm using the Android emulator I can do "adb logcat" to see output messages (log / system.out.println) originated from my code. It also shows the stack trace of exceptions which happen during execution.
But, when I'm using a real phone, "adb logcat" does not do / show anything.
I also tried "adb -d logcat" which also does not display anything.
Is there any way to get it working with the real phone?
Thanks.
UPDATE:
I just tried "adb -s ? logcat" ('?' is the serial number of the device) and also got no results.
I tried another "adb" command to see if anything was working: "adb -s ? bugreport". This printed a lot of stuff. Example: "Memory Info", "CPU Info" and some Java specific things. So it seams that some stuff is working.
Enable USB debugging in your device.
Connect device to computer
Use this commands
--> $adb devices (will give the "device id" that is connected) output ex. 82990AB830201D device
--> $adb -s "device id" logcat (you will be able to see your device logcat)
ex $adb -s 82990AB830201D logcat
I follow this steps and it works good.
这篇关于利用亚行logcat与真正的手机(而不是仿真器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!