Hovatek Forum MOBILE Android [Tutorial] How to enable & disable Qualcomm Diag Port
Can't login? Please, reset your password.
Hovatek is recruiting! Apply Now


[Tutorial] How to enable & disable Qualcomm Diag Port

[Tutorial] How to enable & disable Qualcomm Diag Port

Pages (2): 1 2 Next
hovatek
hovatek
hovatek
Administrator
49,570
26-03-2018, 01:38 PM
#1



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 a Qualcomm Android device using ADB and root.

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


Requirements


How to enable Diag Port


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


Connect the device 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.webp]

ADB command to boot into Qualcomm Android Diag Mode

How to disable Diag Port


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

on some devices like Sony Xperia, try

Code:

setprop sys.usb.configfs 1
setprop persist.sys.usb.config diag,serial_cdev,rmnet,adb
setprop sys.usb.config diag,serial_cdev,rmnet,adb
setprop sys.usb.ffs.ready 1

Important Notice
  • Enabling Diag mode means you might be looking to make a modification to your device. It is recommended you backup your firmware before making any modifications in case it gets bricked
  • Upon your first attempt at gaining root shell access, your device might prompt you whether or not to grant ADB root access so ensure to keep an eye on your phone (remove the lock screen)
  • Some phones might use USSD codes to enable Diag mode without root access. e.g Infinix X623 uses ####8789# . You can search online for any such USSD code for your device model
  • Some boxes/dongles have the boot into Diag Mode feature

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
This post was last modified: 14-11-2023, 11:57 AM by hovatek.

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
murch
murch
murch
Junior Member
15
18-08-2018, 04:04 PM
#2
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...
X3non
X3non
X3non
Recognized Contributor
22,062
18-08-2018, 11:44 PM
#3
(18-08-2018, 04:04 PM)murch 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
murch
murch
murch
Junior Member
15
19-08-2018, 05:18 AM
#4
(18-08-2018, 11:44 PM)X3non
(18-08-2018, 04:04 PM)murch 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)
This post was last modified: 19-08-2018, 11:17 AM by murch.
X3non
X3non
X3non
Recognized Contributor
22,062
19-08-2018, 10:22 PM
#5



(19-08-2018, 05:18 AM)murch 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
This post was last modified: 19-08-2018, 10:24 PM by X3non.
Yoli Macachor
Yoli Macachor
Yoli Macachor
Newbie
1
24-03-2019, 08:33 AM
#6
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.
freshtyt
freshtyt
freshtyt
Senior Member
2,949
24-03-2019, 10:37 PM
#7
(24-03-2019, 08:33 AM)Yoli Macachor 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
c.wallace129
c.wallace129
c.wallace129
Enthusiastic Member
8
22-03-2021, 04:25 AM
#8
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
This post was last modified: 22-03-2021, 04:28 AM by c.wallace129.
Attached Files
.png
Screenshot (1).png
Size: 228.04 KB / Downloads: 11
X3non
X3non
X3non
Recognized Contributor
22,062
22-03-2021, 01:36 PM
#9
(22-03-2021, 04:25 AM)c.wallace129 ...
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?
c.wallace129
c.wallace129
c.wallace129
Enthusiastic Member
8
27-08-2021, 04:41 AM
#10



(22-03-2021, 01:36 PM)X3non
(22-03-2021, 04:25 AM)c.wallace129 ...
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
Pages (2): 1 2 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram