Hovatek Forum
[Tutorial] How to enable or disable Diag mode in Qualcomm using ADB - Printable Version

+- Hovatek Forum (https://forum.hovatek.com)
+-- Forum: MOBILE PHONES HELP SECTION (https://forum.hovatek.com/forum-75.html)
+--- Forum: Android (https://forum.hovatek.com/forum-76.html)
+--- Thread: [Tutorial] How to enable or disable Diag mode in Qualcomm using ADB (/thread-22399.html)

Pages: 1 2


How to enable or disable Diag mode in Qualcomm using ADB - hovatek - 26-03-2018

Some tools require you to enable Diag connection mode in order to fix null / invalid IMEI or flash QCN / EFS. This guide will explain how to enable Diagnostic Mode (Diag Mode) on an Android phone.

Requirements


Steps to enable Diag Mode


Follow the steps below to enable Diagnostic mode (Diag) on an android device

See the video below or @ https://youtu.be/_bEWuzfO2Aw


Connect the phone to the PC (via a USB cable) while powered on. Launch and run the following commands in adb:

Code:
adb devices
adb shell
su
setprop sys.usb.config diag,adb

[Image: How-to-enable-and-disable-Diag-Mode.jpg]

ADB command to boot into Qualcomm Android Diag Mode

Steps to disable Diag Mode


Follow the steps below to disable Diagnostic (diag) mode on an android device

Launch and run the following commands in adb:

Code:
adb devices
adb shell
su
setprop sys.usb.config mtp,adb

Important Notice
Video Transcript
Quote:In this video tutorial, I'll be explaining how to enable and disable Diag mode or diagnostic mode on a Qualcomm Android device using ADB. Diag mode enables you perform advanced functions like writing or restoring qcn, it can also allow you to backup qcn. Writing IMEI etc. For you to enable diag mode, your phone needs to be rooted. We have a guide on how to root using magisk. You also need to have installed your Qualcomm USB drivers. We have a guide on how to do that also. You need to have setup ADB on the PC, we have a guide for that. You need to have the Qualcomm Android device and USB cord.

Now, once you have these in place, you launch device manager and then you leave the phone powered on once in device manager you connect the phone to the PC don't forget the phone should be powered on and take note of what it gets detected as. I have a detection under Portable Devices (Pi Pro). Now, to enable diag mode, you launch command prompt. This is how I'm going to launch command prompt and then you jump to the adb directory although for some devices / laptops you just hold down shift and then right-click and then select open command prompt but I have power shell here so I'm not going to go through that approach. I don't have command prompt here so I'm going to go through this method.

Now, I'm going to copy my adb address folder by right-clicking, selecting copy address then come here (to type) cd *space* right-click to paste the address I'm going to run that again... and then I press ENTER so now I'm in ADB directory so I'm going to run this command adb devices to be sure I have a connection so I've list of device detected. Now I run adb shell and then su . Now at this point, if you are doing it for the first time, you might get a prompt on your device to either allow ADB or to allow shell root access. Either ways, you grant okay. Now, you're going to run this command to boot into diag mode. I'll just copy it here; setprop sys.usb.config diag,adb alright then you tap enter so that is going to enable diag mode.

To confirm, you go back to device manager. Its going to refresh and then you should have an entry like this Qualcomm HS USB Android DIAG 901D so this is your device in diagnostic mode. Now to revert, that is to take the device out of diagnostic mode, you run the same commands if you're starting afresh but if you are where I am currently, you just paste the same command but instead of diag, you change to mtp. it's the same command / procedure. The only difference is mtp or diag. Since I'm in diag mode, I want to revert back to the previous setting which was mtp (just change diag to mtp) and tap Enter oh sorry, I have to run the commands afresh so adb devices adb shell su and then I paste the command but change to mtp and then enter so I check device manager again.

I'm good, I have my device detected under portable devices once again so that's how to enable or disable diag mode or diagnostic mode on a Qualcomm Android device using adb



RE: How to enable or disable Qualcomm Diagnostic (Diag) Mode - murch - 18-08-2018

Hello!
I'm using HTC Sensation (Android revolution hd custom rum, stock kernel, rooted, s-off, bootloader unlocked). I've been trying to open/enable diag ports but when I use those adb commands, nothing happens...
Could you pleae help me out?

Also, not sure if it's related somehow but: although in bootloader the first top line doesn't say "locked", but just "-firmware 3.33-" (so bootloader should be unlocked) when I go into fastboot to check bootloader status by using command:
fastboot oem devices-info

I get this error message:
(bootloader) [ERR] Command error !!!
OKAY [ 0.007s]
finished. total time: 0.007s

Not sure if it's related with the issue of going into diag mode or edl mode though...


RE: How to enable or disable Qualcomm Diagnostic (Diag) Mode - X3non - 18-08-2018

(18-08-2018, 04:04 PM)murch Wrote:  Hello!
I'm using HTC Sensation (Android revolution hd custom rum, stock kernel, rooted, s-off, bootloader unlocked). I've been trying to
...
finished. total time: 0.007s

Not sure if it's related with the issue of going into diag mode or edl mode though...

when you send the command "adb devices" , does your device get displayed on the list in adb window?
attach a screenshot of any error message you receive


RE: How to enable or disable Qualcomm Diagnostic (Diag) Mode - murch - 19-08-2018

(18-08-2018, 11:44 PM)X3non Wrote:  
(18-08-2018, 04:04 PM)murch Wrote:  Hello!
I'm using HTC Sensation (Android revolution hd custom rum, stock kernel, rooted, s-off, bootloader unlocked). I've been trying to
...
finished. total time: 0.007s

Not sure if it's related with the issue of going into diag mode or edl mode though...

when you send the command "adb devices" , does your device get displayed on the list in adb window?
attach a screenshot of any error message you receive

Hi X3non, first of all thanks for your feedback!
Yeah I've already tried the command adb devices and my phone does get listed in the adb window. Also in fastboot the getvar command works and does return the viarable I'm asking for (or all of them, depending on what I'm inputting as a command)


RE: How to enable or disable Qualcomm Diagnostic (Diag) Mode - X3non - 19-08-2018

(19-08-2018, 05:18 AM)murch Wrote:  Hi X3non, first of all thanks for your feedback!
Yeah I've already tried the command adb devices and my phone does get listed in the adb window. Also in fastboot the getvar command works and does return the viarable I'm asking for (or all of them, depending on what I'm inputting as a command)

now i'm confused
can you properly explain what you meant by "...but when I use those adb commands, nothing happens..."
and attach screenshot where necessary
also i hope you know the phone needs to be rooted before trying this


RE: How to enable or disable Diag mode in Qualcomm using ADB - Yoli Macachor - 24-03-2019

He meant is edl not diag mode having a little deffirent in edl you can use a spe ialized USB cable to boot into edl mode you can Google it. U can make it manually by your own.


RE: How to enable or disable Diag mode in Qualcomm using ADB - freshtyt - 24-03-2019

(24-03-2019, 08:33 AM)Yoli Macachor Wrote:  He meant is edl not diag mode having a little deffirent in edl you can use a spe ialized USB cable to boot into edl mode you can Google it. U can make it manually by your own.

edl mode wont do him much good as he's probably trying to fix imei


RE: How to enable or disable Diag mode in Qualcomm using ADB - c.wallace129 - 22-03-2021

tried this using ADB and doesnt work for me
phone Xperia Z
bootloader unlocked
rooted
phone recognized by ADB
qualcomm drivers installed
EDL cable doesnt work also

the only way I can get it into EDL mode is via the testpoints and it doesnt stay for long maybe 1 or 2 minutes and then it resets

accidentally damaged boot partition with TWRP trying to flash a recovery.
doesnt really have a separate boot partition.

when fixing this I used the wrong firmware I thought it was c6602 and it was c6603 it downloaded.
phone unbricked but Imei damaged and needs to be fixed just need to get into edl mode and nothing works but testpoint but doesnt stay long enough to work
no errors in ADB


RE: How to enable or disable Diag mode in Qualcomm using ADB - X3non - 22-03-2021

(22-03-2021, 04:25 AM)c.wallace129 Wrote:  ...
when fixing this I used the wrong firmware I thought it was c6602 and it was c6603 it downloaded.
phone unbricked but Imei damaged and needs to be fixed just need to get into edl mode and nothing works but testpoint but doesnt stay long enough to work
no errors in ADB

is the baseband of the device unknown?
after running the setprop command, is the device detected in device manager?


RE: How to enable or disable Diag mode in Qualcomm using ADB - c.wallace129 - 27-08-2021

(22-03-2021, 01:36 PM)X3non Wrote:  
(22-03-2021, 04:25 AM)c.wallace129 Wrote:  ...
when fixing this I used the wrong firmware I thought it was c6602 and it was c6603 it downloaded.
phone unbricked but Imei damaged and needs to be fixed just need to get into edl mode and nothing works but testpoint but doesnt stay long enough to work
no errors in ADB

is the baseband of the device unknown?
after running the setprop command, is the device detected in device manager?

yes as sonysa107 like before it never changes the only time it changes is when I connect and hold volume down it shows as a somc flash device. the baseband is known
tried edl cable, doesnt work.
I gave up for a while but then firefox deleted my tokens and now I need the number back to access sites with 2 factor id. I only kept the number because so many things are tied to it