Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.mobile.android > #154108 > unrolled thread

PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing

Started byMaria Sophia <mariasophia@comprehension.com>
First post2026-06-10 02:07 -0600
Last post2026-06-30 21:40 -0400
Articles 20 on this page of 52 — 10 participants

Back to article view | Back to comp.mobile.android


Contents

  PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-10 02:07 -0600
    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-11 21:49 -0500
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-12 16:17 -0500
        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Hank Rogers <Hank@nospam.invalid> - 2026-06-12 16:32 -0500
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-13 11:31 -0500
    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-06-15 11:08 +0200
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Paul <nospam@needed.invalid> - 2026-06-15 12:11 -0400
        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing 🇵🇱Jacek Marcin Jaworski🇵🇱 <jmj@energokod.gda.pl> - 2026-06-15 19:24 +0200
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-15 14:10 -0500
            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-15 14:43 -0500
            Re: PSA: Streamlined persistent ADB port over   Wi‑Fi without repeated pairing vallor <vallor@vallor.earth> - 2026-06-17 00:16 +0000
              Re: PSA: Streamlined persistent ADB port over   Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 23:23 -0500
        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-15 13:56 -0500
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Warpinator <invalid@invalid.invalid> - 2026-06-16 00:23 +0100
            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-15 19:18 -0500
              Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-16 12:15 +0200
                Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-30 22:12 -0400
                  Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-07-01 11:51 +0200
                    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-07-01 13:57 -0400
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-16 07:07 +0000
        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 02:21 -0500
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-16 12:30 +0200
            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 12:07 -0500
              Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-16 20:11 +0200
                Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 14:40 -0500
                  Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-16 22:47 +0200
                    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 15:51 -0500
                      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-18 00:45 +0200
                        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Hank Rogers <Hank@nospam.invalid> - 2026-06-17 17:56 -0500
                          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-30 21:46 -0400
                  Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "....winston" <winstonmvp@gmail.com> - 2026-06-16 19:47 -0400
                    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 23:26 -0500
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-16 12:10 +0000
            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-16 12:09 -0500
              Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-16 23:34 +0000
                Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-17 18:59 +0000
                  Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-18 01:31 +0200
                    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-18 06:00 +0000
                      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-18 15:09 -0500
                        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing "Carlos E. R." <robin_listas@es.invalid> - 2026-06-19 00:24 +0200
                          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-18 19:19 -0500
                            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-19 06:59 +0000
                Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Chris <ithinkiam@gmail.com> - 2026-06-17 23:32 +0000
                Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-26 06:38 -0400
    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-20 02:22 -0500
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-20 02:31 -0500
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-21 00:53 -0500
    Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-27 08:58 -0400
      Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Nadia Jarvis <invalid@invalid.invalid> - 2026-06-27 19:38 +0100
        Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Hank Rogers <Hank@nospam.invalid> - 2026-06-27 19:53 -0500
          Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-27 23:01 -0600
            Re: PSA: Streamlined persistent ADB port over Wi‑Fi without repeated pairing Maria Sophia <mariasophia@comprehension.com> - 2026-06-30 21:40 -0400

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#154177

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 02:21 -0500
Message-ID<110qtho$1nk6$1@nnrp.usenet.blueworldhosting.com>
In reply to#154174
Chris wrote:
> I agree that pointing to a stable online resource designed for code is so
> much better than this particular poster's constant tweaking of their
> personal scripts on usenet.

Hi Chris,

C'mon. You're actually complaining that I provided fully working Windows
scripts, and that I improved them, and that I ported them to Linux for you?

Or are you complaining that I didn't test on Linux (as I don't have Linux).

Bear in mind I could have simply asked the perfectly valid question:
 Q: How do you connect to ADB & scrcpy in a single step?
 A: ?

But I did better than that. 
Not only did I ask the question, but I answered the question that I asked.

If you have a *better* method, then I'm all ears. 

Q: What do *you* do to run adb & scrcpy in one step on Windows or Linux?
A: ?
-- 
Some people can do good things, but others simply complain that they can't.

[toc] | [prev] | [next] | [standalone]


#154180

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-16 12:30 +0200
Message-ID<n9cmu2Fas8nU2@mid.individual.net>
In reply to#154177
On 2026-06-16 09:21, Maria Sophia wrote:
> Chris wrote:
>> I agree that pointing to a stable online resource designed for code is so
>> much better than this particular poster's constant tweaking of their
>> personal scripts on usenet.
> 
> Hi Chris,
> 
> C'mon. You're actually complaining that I provided fully working Windows
> scripts, and that I improved them, and that I ported them to Linux for you?

You do not understand the criticism. Or you feign not understanding.

The rest of the post is unrelated, thus deleted


-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#154184

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 12:07 -0500
Message-ID<110rvt4$2fpb$1@nnrp.usenet.blueworldhosting.com>
In reply to#154180
Carlos E. R. wrote:
>> C'mon. You're actually complaining that I provided fully working Windows
>> scripts, and that I improved them, and that I ported them to Linux for you?
> 
> You do not understand the criticism.

If Chris had even once in his entire life ever invested the time and energy
to post a working tutorial or PSA or working code that he labored on to
help himself and others, I'd understand better his complaint that he can't.

[toc] | [prev] | [next] | [standalone]


#154186

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-16 20:11 +0200
Message-ID<n9dhuvFff4aU1@mid.individual.net>
In reply to#154184
On 2026-06-16 19:07, Maria Sophia wrote:
> Carlos E. R. wrote:
>>> C'mon. You're actually complaining that I provided fully working Windows
>>> scripts, and that I improved them, and that I ported them to Linux for you?
>>
>> You do not understand the criticism.
> 
> If Chris had even once in his entire life ever invested the time and energy
> to post a working tutorial or PSA or working code that he labored on to
> help himself and others, I'd understand better his complaint that he can't.

Accusing others doesn't change facts.

-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#154187

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 14:40 -0500
Message-ID<110s8r5$2233$1@nnrp.usenet.blueworldhosting.com>
In reply to#154186
Carlos E. R. wrote:
> On 2026-06-16 19:07, Maria Sophia wrote:
>> Carlos E. R. wrote:
>>>> C'mon. You're actually complaining that I provided fully working Windows
>>>> scripts, and that I improved them, and that I ported them to Linux for you?
>>>
>>> You do not understand the criticism.
>> 
>> If Chris had even once in his entire life ever invested the time and energy
>> to post a working tutorial or PSA or working code that he labored on to
>> help himself and others, I'd understand better his complaint that he can't.
> 
> Accusing others doesn't change facts.

Well, I'm going to ask *you* to provide something that is worth value.

Given I've posted, oh, I don't know, hundreds of useful scripts... 
Q: What specific web site do you suggest I post the final script to?
   a. It needs to have no requirement for a login/account
   b. It needs to be free
   c. It needs to be easy to post to (and to update, if necessary)?
A: ???

To help you add value (instead of just complaining I add too much value), 
all I ask you to do is answer the question above so that I can post it.

Here's a README description of how it simplifies Wi-Fi adb/scrcpy usage 
which should help you find the location you claim I should post it to.

 README: adbconnect.bat
 Automate Android-to-desktop Wi-Fi adb and scrcpy connections
 
 1. Purpose
    A. This script automates connecting a desktop to an Android phone over
       Wi-Fi using adb and scrcpy on your local LAN (in a single step).
    B. It removes unnecessary pairing steps normally required by adb/scrcpy
    C. It launches scrcpy without leaving a console window visible.
 
 2. What the script solves
    A. Eliminates repeated manual pairing steps for Wi-Fi adb.
    B. Avoids the scrcpy console window by generating a temporary VBS
       launcher that runs scrcpy in a hidden window.
    C. Handles device discovery, retries, and fallback logic so the
       connection works even after reboots.
 
 3. How it works
    A. Finds adb automatically on the system path.
    B. Checks whether the phone is already connected.
    C. If not connected, it asks for:
       a. Phone IP address
       b. Pairing port
       c. Pairing code
       d. Debug port
    D. Performs adb pair with retry logic.
    E. Performs adb connect with retry logic.
    F. Detects the actual device id reported by adb, including ephemeral
       ports.
    G. Switches the device to tcpip mode on port 5555.
    H. Connects again on port 5555 for the final stable link.
    I. Builds a temporary VBS file that launches scrcpy silently.
    J. Runs the VBS file, then deletes it.
 
 4. Version history summary
    A. v1p7
       a. Removes dependency on the external no-console VBS file.
       b. Generates a temporary VBS launcher instead.
    B. v1p6
       a. Used the official scrcpy-noconsole.vbs when available.
    C. v1p5
       a. Added prompt for phone LAN IP.
    D. v1p4
       a. Minimized scrcpy console but could not hide it fully.
    E. v1p3
       a. Improved device lookup reliability.
    F. v1p2
       a. Added separate retry counters, fail-fast behavior,
          and added a much more robust device-id parsing.
    G. v1p1
       a. Improved device lookup and retry logic.
    H. v1p0
       a. First batch version replacing the older VBS script.
 
 5. Requirements (root is not required)
    A. Android phone with Wireless debugging enabled.
    B. Desktop with adb and scrcpy installed.
    C. Phone reachable on LAN over Wi-Fi via its IP address.
 
 6. Typical workflow
    A. Run the script.
    B. If already connected, it switches to tcpip mode & launches scrcpy.
    C. If not connected, it asks for pairing info and completes the
       connection automatically.
    D. scrcpy Android mirroring appears without any console window.
 
 7. Notes
    A. The script uses only temporary files and cleans them up.
    B. It avoids all non-essential console output.
    C. It is designed to be safe to run repeatedly.
    D. A Linux port has been provided, but is as yet untested.
-- 
There are people who spend inordinate energy always helping others.

[toc] | [prev] | [next] | [standalone]


#154188

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-16 22:47 +0200
Message-ID<n9dr3bFff49U1@mid.individual.net>
In reply to#154187
On 2026-06-16 21:40, Maria Sophia wrote:
> Carlos E. R. wrote:
>> On 2026-06-16 19:07, Maria Sophia wrote:
>>> Carlos E. R. wrote:
>>>>> C'mon. You're actually complaining that I provided fully working Windows
>>>>> scripts, and that I improved them, and that I ported them to Linux for you?
>>>>
>>>> You do not understand the criticism.
>>>
>>> If Chris had even once in his entire life ever invested the time and energy
>>> to post a working tutorial or PSA or working code that he labored on to
>>> help himself and others, I'd understand better his complaint that he can't.
>>
>> Accusing others doesn't change facts.
> 
> Well, I'm going to ask *you* to provide something that is worth value.
> 
> Given I've posted, oh, I don't know, hundreds of useful scripts...
> Q: What specific web site do you suggest I post the final script to?

Up to you, and it wasn't my idea, anyway :-)

I have never done this, so I can not advise

You could use github, or hire a server of your own somewhere. Or set up 
a server at home. Sourceforge, perhaps (this one I have used).

>     a. It needs to have no requirement for a login/account
>     b. It needs to be free
>     c. It needs to be easy to post to (and to update, if necessary)?
> A: ???
> 
> To help you add value (instead of just complaining I add too much value),
> all I ask you to do is answer the question above so that I can post it.
> 
> Here's a README description of how it simplifies Wi-Fi adb/scrcpy usage
> which should help you find the location you claim I should post it to.
> 

No, this is not relevant to the question.


-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#154189

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 15:51 -0500
Message-ID<110sd0g$19hh$1@nnrp.usenet.blueworldhosting.com>
In reply to#154188
Carlos E. R. wrote:
>> Given I've posted, oh, I don't know, hundreds of useful scripts...
>> Q: What specific web site do you suggest I post the final script to?
> 
> Up to you, and it wasn't my idea, anyway :-)
> 
> I have never done this, so I can not advise
> 
> You could use github, or hire a server of your own somewhere. Or set up 
> a server at home. Sourceforge, perhaps (this one I have used).

The point of the rhetorical question is that it likely doesn't exist.

Only Usenet will allow me to post the code sans creating a login/account.

So Chris is asking me to do that which nobody can do, as far as we know.
-- 
Most people are intuitive so they make guesses without checking them; 
but when they check their intuitive assumptions, they are often wrong.

[toc] | [prev] | [next] | [standalone]


#154204

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-18 00:45 +0200
Message-ID<n9gmcdFugfkU1@mid.individual.net>
In reply to#154189
On 2026-06-16 22:51, Maria Sophia wrote:
> Carlos E. R. wrote:
>>> Given I've posted, oh, I don't know, hundreds of useful scripts...
>>> Q: What specific web site do you suggest I post the final script to?
>>
>> Up to you, and it wasn't my idea, anyway :-)
>>
>> I have never done this, so I can not advise
>>
>> You could use github, or hire a server of your own somewhere. Or set up
>> a server at home. Sourceforge, perhaps (this one I have used).
> 
> The point of the rhetorical question is that it likely doesn't exist.

Oh, yes, they do exist. Many. But you will not like any of them, as they 
serve to find you.

> 
> Only Usenet will allow me to post the code sans creating a login/account.
> 
> So Chris is asking me to do that which nobody can do, as far as we know.

Anybody can do it, and we do. YOU, only you, can not. :-P

-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#154205

FromHank Rogers <Hank@nospam.invalid>
Date2026-06-17 17:56 -0500
Message-ID<110v8n7$27b9k$1@dont-email.me>
In reply to#154204
Carlos E. R. wrote on 6/17/2026 5:45 PM:
> On 2026-06-16 22:51, Maria Sophia wrote:
>> Carlos E. R. wrote:
>>>> Given I've posted, oh, I don't know, hundreds of useful scripts...
>>>> Q: What specific web site do you suggest I post the final script to?
>>>
>>> Up to you, and it wasn't my idea, anyway :-)
>>>
>>> I have never done this, so I can not advise
>>>
>>> You could use github, or hire a server of your own somewhere. Or set up
>>> a server at home. Sourceforge, perhaps (this one I have used).
>>
>> The point of the rhetorical question is that it likely doesn't exist.
> 
> Oh, yes, they do exist. Many. But you will not like any of them, as they 
> serve to find you.
> 
>>
>> Only Usenet will allow me to post the code sans creating a login/account.
>>
>> So Chris is asking me to do that which nobody can do, as far as we know.
> 
> Anybody can do it, and we do. YOU, only you, can not. :-P
> 

Be gentle here.  Mary Sophe is probably a secret agent, and cannot use 
any normal method to distribute her wonderful tutorials.

It's obviously a secret underground thing.  And she faces much danger 
with every tutorial posted.

I admit, it is damn STRANGE.  And I've not yet seen anything of much 
"value".  Perhaps she is holding back the good stuff?

[toc] | [prev] | [next] | [standalone]


#154324

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-30 21:46 -0400
Message-ID<1121ria$21vf$1@nnrp.usenet.blueworldhosting.com>
In reply to#154205
In the beginning, we used USB to connect adb & scrcpy to the desktop PC.
Then in Android 11 we used Wi-Fi pairing with the pairing & debug port.
 $ adbconnect.bat

I used that method even up to Android 13, but I didn't know that in
Android 12, the ability to pair without knowing the ports was added.
 $ adbconnecttls.bat

In using that script to pair without knowing the ports, I've run into a 
bunch of situations depending on the state of the phone & the computer.

Hence, I wrote this debugging-only script to catch all known errors.
As always, please fix where I accidentally omit or err for overall value.

  :: adbdebugtls.bat (Android 12+ ADB/TLS Diagnostic Tool)
  ::
  :: Runs a full diagnostic of ADB-over-TLS, TCP/IP mode, adbd state, 
  :: Wireless Debugging state, and scrcpy readiness for Android 12+.
  @echo off
  setlocal enabledelayedexpansion
  
  :: Version string
  set SCRIPT_VERSION=v1p6
  set SCRIPT_DATE=20260630
  
  echo ============================================
  echo ADB Debug Tool Android 12+ TLS Diagnostic
  echo Running adbdebugtls.bat %SCRIPT_VERSION% %SCRIPT_DATE%
  echo ============================================
  echo.
  ::
  :: v1p6 20260630
  ::  When in deep sleep, a reboot and wireless debugging toggle isn't enough.
  ::  Either we have to authenticate over USB or over Android 11 pairing so
  ::  this version will tell the user what they need to do so as to pair.
  ::
  :: v1p5 20260629
  ::  Added hard deep-sleep check & warning that the phone must be rebooted
  ::  as just toggling Wireless debugging will not wake from hard deep sleep
  ::  Note that we might have to reboot and pair using Android 11 methods.
  ::
  :: v1p4 20260628
  ::   Show TLS recovery suggestions whenever TLS advertiser is ASLEEP
  ::   Added Android 11 pairing-mode instructions (adb pair / adb connect)
  ::   Added Android 12+ Wireless Debugging toggle instructions
  ::   Kept USB fallback instructions for classic TCP/IP mode
  ::
  :: v1p3 20260627
  ::   Added recovery suggestions 
  ::   such as toggle Wireless Debugging, USB fallback, reboot
  ::
  :: v1p2 20260626
  ::   Added TLS-only mode detection
  ::   Added TCP/IP mode detection
  ::   Added USB fallback detection
  ::   Added ADB Deep Sleep Summary block
  ::   Added auto-suggestions inside summary (v1p2)
  ::  
  :: v1p1 20260625
  ::   Added script version and date output
  ::   The TLS advertiser, adbd and the Wireless Debugging service enter
  ::   a deep sleep sate when the phone has been idle for a long time.
  ::   Added comments to explain the debug results when that happens.
  ::
  :: v1p0 20260620
  ::   Diagnose the state of Android's ADB daemon on Android 12+ devices,
  ::   including TLS advertiser status, TCP/IP mode, adbd internal state,
  ::   Wireless Debugging service state and scrcpy readiness.
  ::
  ::   Android 12+ introduced ADB-over-TLS Auto-Discovery, which broadcasts
  ::   on the LAN using mDNS as:
  ::       _adb-tls-connect._tcp
  ::   The desktop ADB server auto-connects to this TLS service as:
  ::       adb-SERIAL._adb-tls-connect._tcp
  ::   This TLS system:
  ::     a. bypasses pairing
  ::     b. bypasses USB authorization
  ::     c. bypasses debug ports
  ::     d. auto-connects whenever ADB restarts
  ::   But scrcpy cannot use TLS directly. It only supports:
  ::     a. USB
  ::     b. Classic TCP/IP ADB (port 5555)
  ::   Hence, this script checks:
  ::     1. TLS advertiser status (adb mdns services)
  ::     2. TCP/IP connectivity on port 5555
  ::     3. adbd internal state via getprop
  ::     4. Wireless Debugging service state via dumpsys
  ::        Note Samsung may hide or rename the Wireless Debugging service.
  ::     5. scrcpy readiness (device state)
  ::   Note the wake attempts when the phone TLS service goes asleep.
  ::     i. Restarting the PC ADB server
  ::     ii. Restarting adbd on the phone (if reachable)
  ::     iii. Forcing TCP/IP fallback on port 5555
  ::   Note Android does not expose a command to toggle Wireless Debugging.
  ::   So the TLS advertiser cannot be automaticaly awakened from ADB.
  ::   Hence, this script reports TLS sleep but cannot force it awake.
  :: 
  :: Set your phone IP here
  set PHONE_IP=192.168.1.4
  
  :: Begin 1 
  echo.
  echo === 1. Restart PC ADB Server ===
  echo adb kill-server
  adb kill-server
  echo adb start-server
  adb start-server
  echo.
  :: End 1 
  
  :: Begin 2 
  echo.
  echo === 2. TLS Status mDNS Advertiser ===
  echo Command: adb mdns services
  adb mdns services | findstr /I "_adb-tls-connect._tcp"
  if errorlevel 1 (
      echo TLS advertiser is ASLEEP.
      echo.
      echo Meaning:
      echo  The phone is NOT broadcasting _adb-tls-connect._tcp
      echo  The Wireless Debugging mDNS service is OFF or in deep sleep
      echo  ADB-over-TLS cannot auto-discover the device
      echo  The PC cannot wake the phone via TLS
      echo.
      echo Why this happens:
      echo  Phone idle for long periods
      echo  Wi-Fi reconnected or changed access points
      echo  Wireless Debugging has not been toggled recently
      echo.
      echo Result:
      echo  TLS mode is unavailable
      echo  Only USB or manual Wireless Debugging toggle can wake adbd
  ) else (
      echo TLS advertiser is ACTIVE.
      echo The phone is broadcasting _adb-tls-connect._tcp.
  )
  
  echo.
  
  :: TLS-only mode detection
  :: This sets %TLS_STATE% for later summary logic
  if errorlevel 1 (
      set TLS_STATE=ASLEEP
  ) else (
      set TLS_STATE=ACTIVE
  )
  
  :: End 2
  
  :: Begin 3
  echo.
  echo === 3. TCP/IP Status Port 5555 ===
  echo Command: adb connect %PHONE_IP%:5555
  adb connect %PHONE_IP%:5555
  
  if errorlevel 1 (
      echo.
      echo TCP/IP mode is OFF.
      echo Port 5555 is CLOSED on the phone.
      echo.
      echo Meaning:
      echo  Classic ADB-over-TCP is disabled
      echo  scrcpy cannot connect over Wi-Fi
      echo  The phone is in TLS-only Wireless Debugging mode
      echo.
      echo Why this happens:
      echo  Android 12+ disables TCP/IP mode automatically
      echo  Happens after reboot, Wi-Fi changes, or long idle periods
      echo  Happens when Wireless Debugging is ON but not paired recently
      echo.
      echo Result:
      echo  adb connect fails with "actively refused 10061"
      echo  Only USB can re-enable TCP/IP mode via "adb tcpip 5555"
  ) else (
      echo TCP/IP mode is ACTIVE on port 5555.
      echo Classic ADB-over-TCP is available.
  )
  
  echo.
  
  echo Command: adb devices
  adb devices
  echo.
  
  :: TCP/IP mode detection
  if errorlevel 1 (
      set TCPIP_STATE=OFF
  ) else (
      set TCPIP_STATE=ON
  )
  :: End 3
  
  :: Begin 4
  echo.
  echo === 4. Attempting to Wake adbd if reachable ===
  echo Trying: adb shell stop adbd
  adb shell stop adbd 2>nul
  echo Trying: adb shell start adbd
  adb shell start adbd 2>nul
  echo.
  :: End 4
  
  :: Begin 5
  echo.
  echo === 5. adbd Internal State ===
  echo Command: adb shell getprop init.svc.adbd
  adb shell getprop init.svc.adbd
  if errorlevel 1 (
      echo.
      echo adbd is UNREACHABLE.
      echo.
      echo Meaning:
      echo  No TLS connection
      echo  No TCP/IP connection
      echo  No USB connection
      echo.
      echo Result:
      echo  Cannot read adbd internal state
      echo  Cannot restart adbd remotely
      echo  Phone is in ADB Deep Sleep mode
  ) else (
      echo adbd internal state retrieved.
  )
  echo.
  
  echo Command: adb shell getprop service.adb.tcp.port
  adb shell getprop service.adb.tcp.port
  echo.
  
  echo Command: adb shell getprop ro.adb.secure
  adb shell getprop ro.adb.secure
  echo.
  :: End 5
  
  :: Begin 6
  echo.
  echo === 6. Wireless Debugging State ===
  echo Command: adb shell dumpsys activity service com.android.adb.adbd
  adb shell dumpsys activity service com.android.adb.adbd
  if errorlevel 1 (
      echo.
      echo Wireless Debugging service is ASLEEP.
      echo.
      echo Meaning:
      echo  The service is not running
      echo  The TLS advertiser is not active
      echo  The phone cannot accept TLS connections
      echo.
      echo Why this happens:
      echo  Android put the service into deep sleep
      echo  Happens after long idle periods or Wi-Fi changes
      echo.
      echo Result:
      echo  Wireless Debugging must be toggled OFF -> ON manually
      echo  Or USB must be used to wake adbd
  ) else (
      echo Wireless Debugging service is ACTIVE.
  )
  
  echo.
  :: End 6
  
  :: Begin 7
  echo.
  echo === 7. scrcpy Readiness Check ===
  echo If device shows as "device", scrcpy can run.
  echo If port 5555 is active, scrcpy --tcpip works.
  echo.
  
  echo Command: adb devices
  adb devices > devices.tmp
  
  :: USB fallback detection
  :: This detects whether
  ::  USB connected as device appears without an IP
  ::  TCP/IP connected as device appears with 192.168.x.x:5555
  ::  Neither, likely meaning deep sleep
  findstr /I "device" devices.tmp | findstr /V ":" >nul
  if not errorlevel 1 (
      set USB_STATE=CONNECTED
  ) else (
      set USB_STATE=DISCONNECTED
  )
  
  echo.
  echo If no devices appear:
  
  echo   ADB cannot reach the phone
  echo   TLS is asleep
  echo   TCP/IP mode is off
  echo   scrcpy cannot run
  echo.
  echo If the phone appears as "device":
  echo   scrcpy can run over USB or TCP/IP
  echo.
  echo If the phone appears as "192.168.x.x:5555 device":
  echo   scrcpy --tcpip will work
  
  echo.
  :: End 7
  
  :: Begin 8
  echo.
  echo === ADB Deep Sleep Summary ===
  
  :: Determine deep sleep state
  if "%TLS_STATE%"=="ASLEEP" (
      if "%TCPIP_STATE%"=="OFF" (
          if "%USB_STATE%"=="DISCONNECTED" (
              echo.
              echo OVERALL STATE: PHONE IS IN ADB DEEP SLEEP MODE.
              echo.
              echo Meaning:
              echo  TLS advertiser asleep
              echo  TCP/IP mode off
              echo  USB not connected
              echo.
              echo Recovery summary:
              echo  1. Toggle Wireless Debugging OFF -> ON
              echo  2. Connect USB and run: adb tcpip 5555
              echo  3. Reboot the phone to restart adbd
          )
      )
  )
  
  if "%USB_STATE%"=="CONNECTED" (
      echo.
      echo OVERALL STATE: USB CONNECTED.
      echo scrcpy can run over USB.
  )
  
  if "%TCPIP_STATE%"=="ON" (
      echo.
      echo OVERALL STATE: TCP/IP MODE ACTIVE.
      echo scrcpy --tcpip will work.
  )
  :: End 8
  
  :: Begin 9
  echo Checking for Hard Deep Sleep...
  adb mdns services | findstr /I "_adb-tls-connect._tcp" >nul
  if errorlevel 1 (
      set TLS_STATE=ASLEEP
  ) else (
      set TLS_STATE=ACTIVE
  )
  
  adb connect %PHONE_IP%:5555 >nul
  if errorlevel 1 (
      set TCPIP_STATE=ASLEEP
  ) else (
      set TCPIP_STATE=ACTIVE
  )
  
  adb devices | findstr /I "device" | findstr /V ":" >nul
  if errorlevel 1 (
      set USB_STATE=NOT_AUTH
  ) else (
      set USB_STATE=AUTHORIZED
  )
  
  echo Checking for Hard Deep Sleep...
  
  :: Hard Deep Sleep means:
  ::   TLS asleep
  ::   TCPIP refusing
  ::   adbd unreachable
  ::   scrcpy failed
  
  if "%TLS_STATE%"=="ASLEEP" (
      if "%TCPIP_STATE%"=="ASLEEP" (
          echo.
          echo Hard Deep Sleep detected.
          echo Wireless Debugging is stuck.
          echo TLS advertiser did not restart.
          echo adbd is unreachable.
          echo scrcpy cannot connect.
          echo.
          echo Fix:
          echo   Reboot the phone to restart Wireless Debugging.
          echo   After reboot, enable Wireless debugging.
          echo   Then re-run adbconnecttls.bat.
          echo.
      )
  )
  
  
  echo.
  echo Android 12+ TLS auto-connect failed.
  echo USB fallback unavailable.
  echo Android 11 Wireless Debugging pairing mode is available.
  echo.
  echo This debug tool does not perform pairing or connection steps.
  echo Use adbconnect.bat to run Android 11 pairing mode.
  echo.
  echo Steps:
  echo   1. On the phone, open Wireless debugging
  echo      Choose "Pair device with pairing code"
  echo   2. Note the IP, pairing port, pairing code, and debug port
  echo   3. Run adbconnect.bat and enter the values when prompted
  echo.
  echo After pairing, adbconnect.bat will:
  echo   Connect to the debug port
  echo   Switch the device to TCP/IP 5555
  echo   Connect to port 5555
  echo   Launch scrcpy
  echo.
  echo This diagnostic script only reports the state and suggests actions.
  
  
  :: End 9
  
  :: Begin 10
  echo.
  echo ============================================
  echo adbdebugtls.bat %SCRIPT_VERSION% %SCRIPT_DATE% Diagnostics complete
  echo ============================================
  
  echo.
  echo ============================================
  echo === Suggested Commands to Fix Wireless Debugging ===
  echo ============================================
  echo.
  echo Your phone is NOT ready for TLS auto-connect.
  echo To make adbconnecttls.bat succeed, do ONE of the following:
  echo.
  
  :: Normal Deep Sleep recommendation
  if "%TLS_STATE%"=="ASLEEP" (
      if "%TCPIP_STATE%"=="OFF" (
          if "%USB_STATE%"=="DISCONNECTED" (
              echo --- Normal Deep Sleep ---
              echo 1. Open Developer options, Wireless debugging
              echo    Toggle Wireless debugging OFF, then ON
              echo    This wakes the TLS advertiser in normal Deep Sleep
              echo.
          )
      )
  )
  
  :: Hard Deep Sleep recommendation
  if "%TLS_STATE%"=="ASLEEP" (
      if "%TCPIP_STATE%"=="ACTIVE" (
          if "%USB_STATE%"=="AUTHORIZED" (
              echo --- Hard Deep Sleep ---
              echo 2. Reboot the phone from the power menu
              echo    Wireless Debugging and TLS will restart cleanly
              echo    After reboot, enable Wireless debugging again
              echo.
          )
      )
  )
  
  echo --- Android 11 Pairing Code Mode ---
  echo 3. On the phone, open Wireless debugging and choose
  echo       Pair device with pairing code
  echo    Note the IP and port shown on the phone
  echo    Then run on the PC
  echo       adb pair ^<ip^>:^<port^>
  echo    After pairing succeeds, run
  echo       adb connect ^<ip^>:^<port^>
  echo.
  
  echo --- USB fallback if USB works ---
  echo 4. Connect USB and run on the PC
  echo       adb devices
  echo       adb tcpip 5555
  echo       adb connect %PHONE_IP%:5555
  echo    This wakes adbd and enables classic TCP/IP mode
  echo.
  
  echo After doing one of these, re-run adbconnecttls.bat
  echo It should now be able to connect successfully
  echo.
  
  :: End 10
  
  endlocal
  exit /b
  
  :: end of adbdebugtls.bat
 -- 
For some people, Usenet is amusement, but for me, it's for adding value.

[toc] | [prev] | [next] | [standalone]


#154193

From"....winston" <winstonmvp@gmail.com>
Date2026-06-16 19:47 -0400
Message-ID<110sn9q$1g9m4$1@dont-email.me>
In reply to#154187
On 06/16/2026 3:40 PM, Maria Sophia wrote:
> Carlos E. R. wrote:
>> On 2026-06-16 19:07, Maria Sophia wrote:
>>> Carlos E. R. wrote:
>>>>> C'mon. You're actually complaining that I provided fully working Windows
>>>>> scripts, and that I improved them, and that I ported them to Linux for you?
>>>>
>>>> You do not understand the criticism.
>>>
>>> If Chris had even once in his entire life ever invested the time and energy
>>> to post a working tutorial or PSA or working code that he labored on to
>>> help himself and others, I'd understand better his complaint that he can't.
>>
>> Accusing others doesn't change facts.
> 
> Well, I'm going to ask *you* to provide something that is worth value.
> 

At this stage...those requests(to anyone) get closer the edge of pettiness.

Be confident in your content, regardless of the feedback especially when 
few reply on its value.
  - for a better assessment of what's been read, a blog might prove more 
visits, then just a simple link to the blog article would/could be 
appropriate for nntp users.


-- 
...w¡ñ§±¤ñ

[toc] | [prev] | [next] | [standalone]


#154197

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 23:26 -0500
Message-ID<110t7mc$gf6$1@nnrp.usenet.blueworldhosting.com>
In reply to#154193
....winston wrote:
> Be confident in your content, regardless of the feedback especially when 
> few reply on its value.
>   - for a better assessment of what's been read, a blog might prove more 
> visits, then just a simple link to the blog article would/could be 
> appropriate for nntp users.

Thanks. I won't respond further unless someone comments on the script.

You're correct that I should go ot the trouble of setting up a blog.

But I don't know how to do that... 

[toc] | [prev] | [next] | [standalone]


#154181

FromChris <ithinkiam@gmail.com>
Date2026-06-16 12:10 +0000
Message-ID<110reg5$13m67$1@dont-email.me>
In reply to#154177
Maria Sophia <mariasophia@comprehension.com> wrote:
> Chris wrote:
>> I agree that pointing to a stable online resource designed for code is so
>> much better than this particular poster's constant tweaking of their
>> personal scripts on usenet.
> 
> Hi Chris,
> 
> C'mon. You're actually complaining that I provided fully working Windows
> scripts, and that I improved them, and that I ported them to Linux for you?

Nope. Try comprehending what I actually wrote rather than responding to
something I didn't. 

[toc] | [prev] | [next] | [standalone]


#154185

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-16 12:09 -0500
Message-ID<110rvvt$2gav$1@nnrp.usenet.blueworldhosting.com>
In reply to#154181
Chris wrote:
>>> I agree that pointing to a stable online resource designed for code is so
>>> much better than this particular poster's constant tweaking of their
>>> personal scripts on usenet.
>> 
>> Hi Chris,
>> 
>> C'mon. You're actually complaining that I provided fully working Windows
>> scripts, and that I improved them, and that I ported them to Linux for you?
> 
> Nope. Try comprehending what I actually wrote rather than responding to
> something I didn't.


In your entire life, how many times have you invested the time and energy
to post a working tutorial or PSA or working code that you labored on to
help yourself and others, and where did you post that working example to?

[toc] | [prev] | [next] | [standalone]


#154192

FromChris <ithinkiam@gmail.com>
Date2026-06-16 23:34 +0000
Message-ID<110smj2$1g4ip$1@dont-email.me>
In reply to#154185
Maria Sophia <mariasophia@comprehension.com> wrote:
> Chris wrote:
>>>> I agree that pointing to a stable online resource designed for code is so
>>>> much better than this particular poster's constant tweaking of their
>>>> personal scripts on usenet.
>>> 
>>> Hi Chris,
>>> 
>>> C'mon. You're actually complaining that I provided fully working Windows
>>> scripts, and that I improved them, and that I ported them to Linux for you?
>> 
>> Nope. Try comprehending what I actually wrote rather than responding to
>> something I didn't.
> 
> 
> In your entire life, how many times have you invested the time and energy
> to post a working tutorial or PSA or working code that you labored on to
> help yourself and others, and where did you post that working example to?

Given I'm a University academic teaching Masters students and supervise PhD
students, plus I've provided professional training to other academics in
software coding principles; quite a lot. 

*I* have posted those on github (search Software Carpentry lessons for an
idea of the kind of thing), on internal student teaching platforms and
staff sharepoint sites. If *I* referenced ("thousands", lol) unfindable
so-called tutorials on usenet in my appraisals, I'd lose all credibility. 

In a former life, I also contributed to the codebase of a linux
distribution. Anonymously <gasp>!

This is why *I* know what *I* am talking about. 

Now, back to *you*. What help do *you* need to do things properly?

[toc] | [prev] | [next] | [standalone]


#154202

FromChris <ithinkiam@gmail.com>
Date2026-06-17 18:59 +0000
Message-ID<110uqqf$235pk$1@dont-email.me>
In reply to#154192
Chris <ithinkiam@gmail.com> wrote:
> 
> In a former life, I also contributed to the codebase of a linux
> distribution. Anonymously <gasp>!
> 
> This is why *I* know what *I* am talking about. 
> 
> Now, back to *you*. What help do *you* need to do things properly?

<crickets>

And, he's gone....

As per usual "the Donald" is only interested in sycophancy or animosity. 

When an offer for help and advice is made he disengages and runs away. 

[toc] | [prev] | [next] | [standalone]


#154206

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-18 01:31 +0200
Message-ID<n9gp37FugfkU2@mid.individual.net>
In reply to#154202
On 2026-06-17 20:59, Chris wrote:
> Chris <ithinkiam@gmail.com> wrote:
>>
>> In a former life, I also contributed to the codebase of a linux
>> distribution. Anonymously <gasp>!
>>
>> This is why *I* know what *I* am talking about.
>>
>> Now, back to *you*. What help do *you* need to do things properly?
> 
> <crickets>
> 
> And, he's gone....

Maybe he only reads alt.os.linux, which you removed. :-?

> 
> As per usual "the Donald" is only interested in sycophancy or animosity.
> 
> When an offer for help and advice is made he disengages and runs away.
> 
> 


-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


#154208

FromChris <ithinkiam@gmail.com>
Date2026-06-18 06:00 +0000
Message-ID<11101i5$2d0mm$1@dont-email.me>
In reply to#154206
Carlos E. R. <robin_listas@es.invalid> wrote:
> On 2026-06-17 20:59, Chris wrote:
>> Chris <ithinkiam@gmail.com> wrote:
>>> 
>>> In a former life, I also contributed to the codebase of a linux
>>> distribution. Anonymously <gasp>!
>>> 
>>> This is why *I* know what *I* am talking about.
>>> 
>>> Now, back to *you*. What help do *you* need to do things properly?
>> 
>> <crickets>
>> 
>> And, he's gone....
> 
> Maybe he only reads alt.os.linux, which you removed. :-?

Turns out he removed the android ng and only replied in the Windows10 ng.
Odd?



[toc] | [prev] | [next] | [standalone]


#154227

FromMaria Sophia <mariasophia@comprehension.com>
Date2026-06-18 15:09 -0500
Message-ID<1111j96$3lmte$1@paganini.bofh.team>
In reply to#154208
Chris wrote:
>> Maybe he only reads alt.os.linux, which you removed. :-?
> 
> Turns out he removed the android ng and only replied in the Windows10 ng.
> Odd?

NOTE: I haven't been able to reply because of a news server issue...
      (and paga says "forbidden crosspost" for these two groups
       alt.comp.os.windows-10,comp.mobile.android
      So I'll just post it to the Android newsgroup instead
      since responding to Chris' wrongful insults adds no value anyway.

I appreciate that Carlos understood that Chris' accusations were unwarranted.

I generally do not remove groups, as I want my messages to be as useful to 
as many as possible, so it's not likely that I was who removed the groups.

But I do appreciate that Chris will apologize now that he's found out that 
I did reply, so all his politically motivated hatred was unwarranted.

While I was waiting for an apology from Chris for his incessant attacks, 
I added a few more useful PSAs to help streamline desktop:android debug.

 Newsgroups: comp.mobile.android,alt.comp.os.windows-10,alt.os.linux
 Subject: PSA: How to capture Android crash logs or app errors & warnings on your desktop using adb & logcat
 Date: Wed, 17 Jun 2026 01:13:00 -0500
 Message-ID: <110tdtc$2qt$1@nnrp.usenet.blueworldhosting.com>

 Newsgroups: comp.mobile.android
 Subject: PSA: How to ID from the desktop what just made Android beep (using adb logcat)
 Date: Wed, 17 Jun 2026 14:53:46 -0500
 Message-ID: <110uu09$39vsm$1@paganini.bofh.team>
-- 
Some people can add value by building useful cross-platform tool suites.

[toc] | [prev] | [next] | [standalone]


#154228

From"Carlos E. R." <robin_listas@es.invalid>
Date2026-06-19 00:24 +0200
Message-ID<n9j9h0F97blU5@mid.individual.net>
In reply to#154227
On 2026-06-18 22:09, Maria Sophia wrote:
> Chris wrote:
>>> Maybe he only reads alt.os.linux, which you removed. :-?
>>
>> Turns out he removed the android ng and only replied in the Windows10 ng.
>> Odd?
> 
> NOTE: I haven't been able to reply because of a news server issue...
>        (and paga says "forbidden crosspost" for these two groups
>         alt.comp.os.windows-10,comp.mobile.android
>        So I'll just post it to the Android newsgroup instead
>        since responding to Chris' wrongful insults adds no value anyway.

There have been no insults, Arlen. Criticism, yes.

...

-- 
Cheers,
        Carlos E.R.
        ES🇪🇸, EU🇪🇺;

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.mobile.android


csiph-web