如何從Android IP手機收集調試信息?

簡介

概述

安卓網路電話機在內部測試或客戶部署過程中發生故障時,技術人員需要提供偵錯資訊用於故障排除與分析。本指南說明如何蒐集所需的診斷檔案。

支援機型

GP32i、BX7A、BF600S、BJ7A、Bi56A

準備條件

1. 準備一台安卓網路電話機、一個隨身碟、一台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偵錯,需手動開啟。

將隨身碟插入話機,進入設定 > 關於裝置,連續點擊韌體版本號五次,開啟開發人員模式

開啟開發人員模式

                                                                                                                     圖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 .