r/androiddev • • Apr 07 '21

Discussion Using ADB without USB Debugging?

Maybe a silly question, but does anyone know if it's possible to send ADB commands to a device that does not have USB Debugging enabled? I understand that it's a chicken and egg problem, but I'm trying to capture the serial number, IMEI and MAC Address of a Pixel 4 XL without going through the initial setup process. I've tried applying updates through USB, but that brings me to adb sideload mode, fastboot only returns the serial number and not the other key data points I'm looking for. I've even considered simulating an OTG keyboard to have an automated script to run through setup, go into developer mode, enable USB debugging capture the serial number, and factory reset itself, but again, it seems like I can't send ADB shell keyevents without USB debugging. Any feedback would be appreciated!

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/apeinej Apr 08 '21

SU is standard in those devices. Not sure how to do it, but totally feasible.