You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过USB线缆查看Flutter应用的控制台输出?

查看App Center启动的Flutter应用控制台日志方法

Android设备

  • 确保设备已通过USB连接并开启开发者模式,电脑上配置好adb环境
  • 打开终端,执行命令过滤Flutter相关日志:
    adb logcat -s flutter
    
  • 如需精准过滤指定应用日志,可结合包名:
    adb logcat -s flutter:V 你的应用包名:V
    
  • 注意:release版本应用的部分调试日志可能被编译优化移除,测试优先使用debug包

iOS设备

方法1:通过Xcode查看

  • 打开Xcode,点击顶部菜单栏Window -> Devices and Simulators
  • 在左侧列表选中已连接的iOS设备,切换到Console标签页
  • 在搜索框输入flutter或应用包名,过滤目标日志

方法2:通过命令行查看

  • 打开终端,执行命令过滤应用日志(替换为你的应用包名):
    log show --predicate 'processImagePath contains "com.yourcompany.yourapp"' --style compact --info
    
  • 若要实时查看日志,添加--stream参数:
    log show --predicate 'processImagePath contains "com.yourcompany.yourapp"' --style compact --info --stream
    

内容的提问来源于stack exchange,提问作者YGranja

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 10:02:34