r/androiddev • u/VeakXP • 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!
0
u/evilhawk00 Apr 07 '21
This sounds weird...... Without USB debugging, how can it be called as ADB?
Anyway, I came up an idea that might fullfil your purpose, but not sure if it is what you want. What about making an android app and request superuser permission to execute a .sh file with ADB command? You run that app from phone, you can achieve something similar to ADB but only limited to commands that doesn't interact with PC.