如何从Android IP手机收集调试信息?

简介

概述

安卓网络电话机在内部测试或客户部署过程中出现故障时,技术人员需要提供调试信息用于故障排查与分析。本指南说明如何采集所需的诊断文件。

支持机型

GP32i、BX7A、BF600S、BJ7A、Bi56A

准备条件

1. 准备一台安卓网络电话机、一个U盘、一台PoE交换机或直流电源。将话机连接至交换机。

2. 准备一台调试用电脑,并将其连接至同一台交换机。确保电脑与话机可正常网络通信。

设备与电脑连接图

将安卓网络电话机(本例以A32i为例)连接至交换机,电脑也连接至同一交换机。确保电脑与设备网络互通。连接示例如图1所示。

设备与电脑连接图

                 图1. 设备与电脑连接图

故障排查方法

根据故障类型不同,需要采集不同的诊断信息进行分析。以下章节说明不同场景下需要提供的文件。

通用场景

绝大多数情况下,需采集以下三个文件并提交给研发团队:

1. 调试系统日志文件
登录话机网页管理界面,进入系统 > 支持页面,找到系统日志选项。

配置如下参数:

1) 启用系统日志
2) 将服务器地址设置为本地电脑的IP地址
3) 将服务器端口设置为514
4) 将系统日志级别设置为调试
5) 启用导出日志
6) 复现故障后,点击导出日志下载系统日志文件

导出调试系统日志

                                                                                                                                   图2. 导出调试系统日志

2. 调试包
调试包包含话机的缓存日志、运行信息、固件详情及其他内部诊断数据,可通过网页界面导出。

进入系统 > 支持工具,找到一键导出调试信息选项,点击导出。该过程约需一分钟完成。

导出调试包

                                                                                                                                        图3. 导出调试包

3. 网络抓包文件
抓包文件会记录收发的网络数据包,可通过Wireshark等工具进行分析。

抓包操作步骤:

1) 点击开始,等待网页启动抓包进程
2) 复现故障
3) 故障复现后,点击停止
4) 打开浏览器下载页面,找到抓包文件

网络抓包

                                                                                                                                          图4. 网络抓包

特殊场景

提交上述三个文件后,部分场景仍需补充额外信息。

研发团队要求时

研发团队分析完系统调试日志、调试包和抓包文件后,可能需要安卓实时日志用于深度分析。以下章节说明如何通过ADB采集安卓实时日志。

安卓实时日志
话机运行时,安卓系统会持续输出运行日志,该日志可帮助工程师定位和分析问题。

1. 在电脑上安装ADB工具

可通过以下地址下载适配操作系统的ADB工具:

https://developer.android.google.cn/studio/releases/platform-tools

安装完成后,将ADB安装路径添加至系统环境变量。Windows系统中,进入此电脑 > 属性 > 高级系统设置 > 高级 > 环境变量,将ADB目录的绝对路径添加到Path变量中。

添加ADB路径

                                                                                                        图5. 添加ADB路径

打开电脑命令提示符,输入adb命令。若命令正常运行,代表ADB安装成功。

ADB安装成功

                                                                                                          图6. ADB安装成功

2. 在话机上开启USB调试

2020年12月1日后发布的安卓固件,默认关闭ADB调试,需手动开启。

将U盘插入话机,进入设置 > 关于设备,连续点击固件版本号五次,开启开发者模式

开启开发者模式

                                                                                                                     图7. 开启开发者模式

随后进入设置 > 系统 > 开发者选项,开启USB调试

开发者选项页面开启USB调试

                                                                                                                图8. 开启USB调试

3. 修改调试日志级别

话机默认日志级别为通知,仅记录核心信息。如需采集更详细的日志,将日志级别修改为追踪

进入话机设置 > 系统维护 > 工具,将日志级别设置为追踪

修改日志级别

                                                                                                                  图9. 修改日志级别

4. 采集实时日志

使用以下ADB命令:

adb connect 172.18.8.28
172.18.8.28替换为话机实际IP地址。该命令通过网络连接话机。

adb devices
该命令列出已连接设备,用于验证话机是否连接成功。

adb logcat -G 16M
该命令扩大日志缓冲区,可存储更多日志内容。

adb logcat > logcat-202111051708.log
该命令将实时日志输出保存至电脑文件。推荐命名格式:年+月+日+时+分+秒+.log

采集实时日志

                                                                                                              图10. 采集实时日志

日志采集完成后,执行命令:

adb disconnect 172.18.8.28

该命令断开电脑与话机的连接。随后可在电脑对应目录找到生成的实时日志文件。

实时日志文件路径

                                                                                                                   图11. 实时日志文件路径

屏幕相关故障

若故障与液晶显示屏或显示效果相关,还需提供截图文件。

登录话机网页管理界面,进入系统 > 支持页面,找到屏幕截图选项。点击保存图片下载并保存截图。

保存屏幕截图

                                                                                                                 图12. 保存屏幕截图

目录
客服 电话
We use cookie to improve your online experience. By continuing to browse this website, you agree to our use of cookie.

Cookies

This Cookie Policy explains how we use cookies and similar technologies when you access or use our website and related services. Please read this Policy together with our Terms and Conditions and Privacy Policy so that you understand how we collect, use, and protect information.

By continuing to access or use our Services, you acknowledge that cookies and similar technologies may be used as described in this Policy, subject to applicable law and your available choices.

Updates to This Cookie Policy

We may revise this Cookie Policy from time to time to reflect changes in legal requirements, technology, or our business practices. When we make updates, the revised version will be posted on this page and will become effective from the date of publication unless otherwise required by law.

Where required, we will provide additional notice or request your consent before applying material changes that affect your rights or choices.

What Are Cookies?

Cookies are small text files placed on your device when you visit a website or interact with certain online content. They help websites recognize your browser or device, remember your preferences, support essential functionality, and improve the overall user experience.

In this Cookie Policy, the term “cookies” also includes similar technologies such as pixels, tags, web beacons, and other tracking tools that perform comparable functions.

Why We Use Cookies

We use cookies to help our website function properly, remember user preferences, enhance website performance, understand how visitors interact with our pages, and support security, analytics, and marketing activities where permitted by law.

We use cookies to keep our website functional, secure, efficient, and more relevant to your browsing experience.

Categories of Cookies We Use

Strictly Necessary Cookies

These cookies are essential for the operation of the website and cannot be disabled in our systems where they are required to provide the service you request. They are typically set in response to actions such as setting privacy preferences, signing in, or submitting forms.

Without these cookies, certain parts of the website may not function correctly.

Functional Cookies

Functional cookies enable enhanced features and personalization, such as remembering your preferences, language settings, or previously selected options. These cookies may be set by us or by third-party providers whose services are integrated into our website.

If you disable these cookies, some services or features may not work as intended.

Performance and Analytics Cookies

These cookies help us understand how visitors use our website by collecting information such as traffic sources, page visits, navigation behavior, and general interaction patterns. In many cases, this information is aggregated and does not directly identify individual users.

We use this information to improve website performance, usability, and content relevance.

Targeting and Advertising Cookies

These cookies may be placed by our advertising or marketing partners to help deliver more relevant ads and measure the effectiveness of campaigns. They may use information about your browsing activity across different websites and services to build a profile of your interests.

These cookies generally do not store directly identifying personal information, but they may identify your browser or device.

First-Party and Third-Party Cookies

Some cookies are set directly by our website and are referred to as first-party cookies. Other cookies are set by third-party services, such as analytics providers, embedded content providers, or advertising partners, and are referred to as third-party cookies.

Third-party providers may use their own cookies in accordance with their own privacy and cookie policies.

Information Collected Through Cookies

Depending on the type of cookie used, the information collected may include browser type, device type, IP address, referring website, pages viewed, time spent on pages, clickstream behavior, and general usage patterns.

This information helps us maintain the website, improve performance, enhance security, and provide a better user experience.

Your Cookie Choices

You can control or disable cookies through your browser settings and, where available, through our cookie consent or preference management tools. Depending on your location, you may also have the right to accept or reject certain categories of cookies, especially those used for analytics, personalization, or advertising purposes.

Please note that blocking or deleting certain cookies may affect the availability, functionality, or performance of some parts of the website.

Restricting cookies may limit certain features and reduce the quality of your experience on the website.

Cookies in Mobile Applications

Where our mobile applications use cookie-like technologies, they are generally limited to those required for core functionality, security, and service delivery. Disabling these essential technologies may affect the normal operation of the application.

We do not use essential mobile application cookies to store unnecessary personal information.

How to Manage Cookies

Most web browsers allow you to manage cookies through browser settings. You can usually choose to block, delete, or receive alerts before cookies are stored. Because browser controls vary, please refer to your browser provider’s support documentation for details on how to manage cookie settings.

Contact Us

If you have any questions about this Cookie Policy or our use of cookies and similar technologies, please contact us at support@becke.cc .