【问题标题】:How to debug an activity started with an Intent?如何调试以 Intent 开始的活动?
【发布时间】:2021-03-07 22:08:30
【问题描述】:

在我正在进行的项目中,我们导入了其他几个模块。为了让大家可以更好地可视化它,假设我有 M1(Module 1) M2(模块 2)M1startActivity(m2Intent) 开头 M2。我在 M1 中有几个 断点,在 M2 中有几个断点。如果我单独调试两个模块,则会命中活动的断点。那里没有什么不寻常的地方。如果我一起调试它们(意味着 M2intentM1 启动)M2断点 > 从不打。

有一点值得注意,M2 打印的任何日志在 logcat 中都是可见的,即使 断点 不起作用。

【问题讨论】:

    标签: android debugging android-intent android-activity


    【解决方案1】:

    我想通了。每次我需要一起调试 M1M2 时,我必须执行以下操作:

    1. M1的第一个断点命中,我进入run>attach debugger to android process
    2. 确保将debugger settingsdebug type 设置并选择为M2
    3. 现在 断点 用于 M2 命中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-08
      • 1970-01-01
      相关资源
      最近更新 更多