【问题标题】:how to work on android mobile logcat如何在 android 移动 logcat 上工作
【发布时间】:2014-02-15 05:16:36
【问题描述】:

如果有可能在 android mobile 中看到什么类型的运行时异常?因为我开发了一个在模拟器中运行良好但在移动设备中停止运行的应用程序.. 有没有 Log-cat.. [a Log-cat]:https://play.google.com/store/apps/details?id=org.jtb.alogcat&hl=en 不显示错误..!我找不到任何关于“a Log-cat”apk 的教程。请帮帮我!!提前感谢

【问题讨论】:

  • 如果从命令行执行,adb logcat {flags} 会执行。否则你的 IDE 应该有一个内置的 LogCat。您使用的是 Eclipse 还是 IntelliJ?
  • 我正在我的手机上运行我自己的 apk.. 它停止工作,我想看看它是什么类型的异常
  • 你在手机上编程吗?还是你在用电脑?

标签: android exception-handling apk logcat


【解决方案1】:

您会发现很多应用程序可以读取已安装应用程序的日志,但它们需要root permissions 才能显示异常。

【讨论】:

  • 如果它的简单生根或任何困难??
【解决方案2】:

如果您安装了 sdk 工具,如果您在连接到计算机时运行 apk,则可以从中访问 log cat。如果您使用 eclipse,甚至有一个人可以轻松访问它,否则有命令行工具。

本质上,将其插入您的计算机,您就可以访问日志。

【讨论】:

    【解决方案3】:

    我建议你完成:

    https://developer.android.com/training/basics/firstapp/index.html?hl=cn

    因为它将帮助您进行设置并教您使用这些工具。如果您不想这样做:

    命令行:

    http://developer.android.com/tools/help/logcat.html

    日食:

    How to enable LogCat/Console in Eclipse for Android? How to debug on a real device (using Eclipse/ADT)

    IntelliJ

    https://www.jetbrains.com/idea/webhelp/debugging-with-logcat.html

    简短:root 并使用应用程序查看日志猫,或将其插入您的计算机。

    【讨论】:

      【解决方案4】:

      你可以试试这段代码来查看

      try{
          //do something
      }catch(Exception e){
          Toast.makeText(context,e.message(),Toast.LENGTH_LONG).show();
          //or you can start a new ACTIVITY and put STACKTRACE in a TextView
      }
      

      但这有一个缺点,您应该知道Exception 可能出现在您应用程序的哪个部分。
      我已经使用Toast 进行了尝试。希望对您有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-04-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多