The reason
This is deliberately omitted from production Android. If it was allowed, it would be trivial to read the contents of a lost or stolen phone. Since many people keep much of their lives on their phone, this would be a huge security problem.
As it is, someone who obtains a phone that belongs to someone else has to get through the screen lock (PIN, pattern, fingerprint, etc.) before they can enable USB debugging. If they can get through the screen lock, they can use the phone and its apps anyway, and the ability to enable USB debugging does not make things much worse.
A possible solution for an individual
If you enable developer mode and USB debugging, then authorise a computer with the pop-up, you can check the box "Always allow from this computer" and then the phone will connect to adb
as soon as you plug it in. With more recent versions of Android than the 7.1 in the question, you should turn on "Disable adb authorisation timeout" in Settings => Developer Options if you want authorisation to persist longer than a week.
You can enable that for all your computers individually. Alternatively, you can enable it for any computer that you can copy a few files onto. This is a bit more of a risk, but it may suit the OP's needs.
The .android directory and its contents
The information that an Android device uses to recognise a host computer isn't a built-in part of the host. Instead, it is created by adb
when you first run it on the host. In your user directory, you'll find a directory called .android
. If you copy that directory and its contents to another computer where adb
has never been run, and then install and run adb
, the two computers will be treated by the device as being the same computer.
On Windows
You should use the Command Prompt for this. If you don't know how to use that, learn: it's basic technical computing, and if you can't learn this, you should not be tinkering with Android USB debugging.
In the command prompt:
C:\> echo %USERPROFILE%
C:\Users\ExampleUser
C:\>dir %USERPROFILE%
Volume in drive C is Local Disk
Volume Serial Number is Q8P4-Q7KQ
Directory of C:\Users\ExampleUser
22/07/2023 15:51 <DIR> .
12/10/2023 06:47 <DIR> ..
08/06/2023 20:19 <DIR> .android
...
28/08/2023 15:37 <DIR> Desktop
16/10/2023 03:21 <DIR> Documents
17/10/2023 14:58 <DIR> Downloads
...
0 File(s) 0 bytes
14 Dir(s) 373,509,562,890 bytes free
Copy the .android
directory and its contents to the corresponding place on another computer. Provided you keep this data safe, you can use it to authorise any future computer, even one you don't have yet.
On Linux or macOS
In the shell:
ls -ald ~/.android
Other solutions
Extremely custom ROMs
If you're willing to rebuild Lineage OS from source, you should be able to build it with USB debugging pre-enabled and then flash a Lineage OS supported device with it. However, using such a device as your personal device would be silly: if you lost it, it's trivial for someone to get into it.
Devices that come pre-enabled for USB debugging
For completeness, there are devices that can run Android that come pre-enabled for USB debugging. However, they are not phones or tablets that you'd want to carry around. They're single-board computers, a bit like Raspberry Pis, designed for doing heavy-duty hardware or software development. They're intended to live in labs, not to be personal devices.
Non-solutions
Termux has no reference to doing this in its wiki.
adb pull
content from your device.