4

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

  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 ?

I'm using Google Nexus 5.

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

Saurabh Meshram
  • 8,106
  • 3
  • 23
  • 32

5 Answers5

4

1- I personally use DM to 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.

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

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!

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

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

Odin
  • 226
  • 3
  • 14
3
  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 only if your phone is rooted.

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

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

  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:

setprop sys.usb.config mtp

You'll get back to MTP mode :)

Gokul NC
  • 1,111
  • 4
  • 17
  • 39
  • what if init.xxxxxxx.usb.rc doesn't contain anything related to diag ? e.g on property:sys.usb.config= . I am using g2 with cm13 and my init.g2.usb.rc doesn't have anything related to diag mode – Abdul Rauf Jul 23 '16 at 04:54
  • Also check in `init.usb.rc`. If it's not present even there, it means your kernel doesn't support diag mode. – Gokul NC Jul 23 '16 at 11:29
  • init.usb.rc is AOSP file and there is no diag mode in this file. LG G2 D800 supports diag mode via usb setting code on stock ROM. I am facing this issue on CM13 – Abdul Rauf Jul 23 '16 at 15:15
  • Setting the sys.usb.config property doesn't seem to be sufficient for my Galaxy S5 Sprint SM-G900P. Even with that set to `diag,acm,adb`, the diagnostic port does not show up in device manager. I may not have all of the necessary drivers, but I sure as heck don't know where to find them. [Samsung's drivers](http://www.samsung.com/us/support/owners/product/SM-G900PZKASPR) are installed, but I'm not sure if there's another diagnostic driver that I still need to find somewhere. – nimble_ninja Sep 22 '16 at 17:47
  • You need to specifically install Qualcomm drivers for your chipset type.. – Gokul NC Sep 23 '16 at 11:42
0

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.

  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.
Panama Jack
  • 24,158
  • 10
  • 63
  • 95
  • No, I'm not looking for Developer Option. I have already done that by doing this [http://www.gottabemobile.com/2013/11/10/enable-developer-options-nexus-5-kitkat/], USB Debugging also enabled. I'm precisely looking to access Modem Functionalities. So to trace Radio Interface Logs, I have followed this procedure [http://forum.xda-developers.com/nexus-4/orig-development/enable-nexus-4-diag-mode-qpst-t2211058] but no way to tell if it worked. I have also tried this [http://android.stackexchange.com/questions/8194/what-does-the-4636-dialer-code-do] but not sure if this is **exactly** DIAG Mode. – Saurabh Meshram Jun 03 '14 at 05:29
  • Where did he mention Developer option in his question? worst answer I have ever seen. – Hulk Sep 02 '14 at 02:51
  • @Hulk just because it didn't help you doesn't make it the worst answer. I purposely mentioned in my first sentence that I thought he was referring to developer options. Why? Because his last sentence said `I'm fairly new to Android Development`. Most of the time you do not need Diag for android development. Also because dev mode has to be disabled again, DIAG is just a menu which you exit. So his 4th question sounded more like dev mode. So it seemed like he was asking for something else. – Panama Jack Sep 02 '14 at 07:04
0

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.

nightElf91
  • 650
  • 1
  • 7
  • 28
0

If the following command does not work:

su setprop sys.usb.config diag,adb

You can try:

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

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

Stevy
  • 3,228
  • 7
  • 22
  • 38