Android 诊断模式 - 如何启用它?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24006903/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:43:35  来源:igfitidea点击:

Android Diagnostic Mode - How to Enable it?

androiddiagnosticsadb

提问by Saurabh Meshram

I would Like to enable Diagnostic (DIAG) Modeon Android. I have the following questions about the same.

我想在 Android 上启用诊断 (DIAG) 模式。我有以下相同的问题。

  1. How is DIAG mode helpful ?
  2. Is Rooting the Device necessary to enable DIAG Mode ?
  3. How to verify if DIAG mode is enabled ?
  4. Is it reversible ? Can i go back to Normal Mode ?
  1. DIAG 模式有何帮助?
  2. 启用 DIAG 模式是否需要 Root 设备?
  3. 如何验证是否启用了 DIAG 模式?
  4. 它是可逆的吗?我可以回到普通模式吗?

I'm using Google Nexus 5.

我正在使用 Google Nexus 5。

I'm fairly new to Android Development. Any help would be appreciated.

我对Android开发相当陌生。任何帮助,将不胜感激。

回答by Odin

1-I personally use DMto collect and analyse the messages between a mobile (UE) and a network. I use it with Qualcomm QXDM and QPST tools to analyse wireless protocol stack messages. With commercial phones, usually the DM is blocked as a security measure as it allows you to decapsulate the messages sent/received by the UE. I haven't heard about another use for it until now.

1-我个人使用DM来收集和分析移动设备 (UE) 和网络之间的消息。我将它与 Qualcomm QXDM 和 QPST 工具一起使用来分析无线协议栈消息。对于商用电话,通常会阻止 DM 作为安全措施,因为它允许您解封 UE 发送/接收的消息。直到现在我还没有听说过它的其他用途

2-Yes all the commercial UEs I worked with ( mostly with Sony Xperia and currently with Xperia Ray) are rooted.

2-是的,我使用过的所有商业 UE(主要使用 Sony Xperia,目前使用 Xperia Ray)都已植根。

3-If DIAG mode is enabled, you can see it in your Device Manager. Here is a snapshot of mine. That means you have to install the correct drivers for the device (which was tricky with many phones). The device should has Qualcomm Chipset!

3-如果启用了 DIAG 模式,您可以在设备管理器中看到它。这是我的快照。这意味着您必须为设备安装正确的驱动程序(这对于许多手机来说很棘手)。设备应该有高通芯片组!

4-Yes you can unroot the device. Never tried with Nexus myself.

4-是的,您可以取消设备的root权限。我自己从未尝试过 Nexus。

Can I ask what is the purpose of using it for you? I mean it's strictly working with protocol stacks.

请问你用它的目的是什么?我的意思是它严格使用协议栈。

Hope it helps! Cheers

希望能帮助到你!干杯

回答by Gokul NC

  1. Diagnostics Mode can be used to change your device's radio band & modem settings and other stuff like changing IMEI address or MAC Address, if you have appropriate software like DFS CDMA Tool or QPST.

  2. You can enable it onlyif your phone is rooted.

  1. 如果您有适当的软件,如 DFS CDMA 工具或 QPST,诊断模式可用于更改您设备的无线电频段和调制解调器设置以及其他内容,如更改 IMEI 地址或 MAC 地址。

  2. 当您的手机已植根时才能启用它。

Make sure Qualcomm drivers for your phone are installed in computer.

确保您手机的 Qualcomm 驱动程序已安装在计算机中。

Enter this in Terminal Emulator in your device:

在您设备的终端模拟器中输入:

su
setprop sys.usb.config diag,adb

Note:This will work only if your phone's ramdisk has the appropriate configs enabled for the 'diag,adb' property. If that didn't work, better open /init.xxxxxxx.usb.rc(xxxxxxx represents your device's codename or chipname or whatever) and check for properties related to 'diag'.

注意:只有当您手机的 ramdisk 为“diag,adb”属性启用了适当的配置时,这才有效。如果这不起作用,最好打开/init.xxxxxxx.usb.rc(xxxxxxx代表您设备的代号或芯片名称或其他)并检查与“ diag”相关的属性。

  1. To verify if it's working, just check the Device Manager or the tool you're using & check if your phone gets connected.

  2. Yes, it's reversible. To get back to normal mode, just type this in Terminal Emulator:

  1. 要验证它是否正常工作,只需检查设备管理器或您正在使用的工具并检查您的手机是否已连接。

  2. 是的,它是可逆的。要返回正常模式,只需在终端模拟器中输入:

setprop sys.usb.config mtp

setprop sys.usb.config mtp

You'll get back to MTP mode :)

你会回到 MTP 模式 :)

回答by Michael Angel

If the following command does not work:

如果以下命令不起作用:

su setprop sys.usb.config diag,adb

su setprop sys.usb.config diag,adb

You can try:

你可以试试:

su setprop sys.usb.config diag,serial_cdev,rmnet,adb

su setprop sys.usb.config diag,serial_cdev,rmnet,adb

Both set of commands require root. The difference has to do with modem processors.

两组命令都需要root。差异与调制解调器处理器有关。

回答by Panama Hyman

If you mean the developer options, then as of Android 4.2 I believe, one of the things about the developer options is that the menu is just hidden now. You have to purposely enable the menu to access the options.

如果您指的是开发人员选项,那么我相信从 Android 4.2 开始,关于开发人员选项的一件事就是菜单现在只是隐藏的。您必须有意启用菜单才能访问选项。

  1. It's helpful because you need it to help debug your apps while it's connected to your computer and the SDK. There are a lot of options there, depending on what kind of app you are making. Enabling the menu by itself does not do anything to your device.
  2. No it's not necessary.
  3. If you see developer options in the settings menu, then you know it's enabled.
  4. All you are doing is unhiding the hidden developer menu. Not really anything to reverse. You can just turn off the options you turned on during development.
  1. 它很有用,因为您需要它来帮助调试连接到计算机和 SDK 的应用程序。那里有很多选项,具体取决于您正在制作的应用程序类型。单独启用菜单不会对您的设备产生任何影响。
  2. 不,这是没有必要的。
  3. 如果您在设置菜单中看到开发人员选项,那么您就知道它已启用。
  4. 您所做的就是取消隐藏隐藏的开发人员菜单。真的没有什么可以逆转的。您可以关闭在开发过程中打开的选项。

回答by nightElf91

I dont know much about DIAG mode but it's used when you want to read data from phone using qualcomm settings. To get into DIAG mode use ##3424# or *#7284#. And enable DM+MOdem+.. on.

我对 DIAG 模式了解不多,但是当您想使用 qualcomm 设置从手机读取数据时使用它。要进入 DIAG 模式,请使用 ##3424# 或 *#7284#。并启用 DM+MODEm+.. 。