我已经导入了库。我在屏幕上看不到任何消息。日志猫似乎没有为我工作
final String temp = "temp";
int counter =0;
Log.v(temp, "counter is " +counter);
counter =20;
Log.v(temp," counter is " +counter);
我已经导入了库。我在屏幕上看不到任何消息。日志猫似乎没有为我工作
final String temp = "temp";
int counter =0;
Log.v(temp, "counter is " +counter);
counter =20;
Log.v(temp," counter is " +counter);
几件事情:
1)设置可调试= “真” 在你的Android清单。
首先关闭和开启eclipse。然后以调试模式运行。
我usuall使用
Log.debug("classname", "counter is "+counter);
2)尝试在调试模式下运行,看看你会得到什么。
也不需要导入另一个记录器。只需使用Android附带的那个。
import android.util.Log;
另一个有用的事情(对于这个问题)是打开android sdk的安装目录和窗口。从那里你可以运行adb kill-server和adb start-server等。adb设备还有其他有用的东西,比如adb设备告诉你调试器是否看见设备。所以把adb放在你的道路上。我认为它在bin目录或android sdk下。
您是否启用了USB调试功能? – cklab 2012-07-17 23:59:04