<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Android Debug Bridge on Ivon's Blog</title><link>https://ivonblog.com/en-us/tags/android-debug-bridge/</link><description>Recent content in Android Debug Bridge on Ivon's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>infoivonblog.nkfjt@aleeas.com (Ivon Huang)</managingEditor><webMaster>infoivonblog.nkfjt@aleeas.com (Ivon Huang)</webMaster><copyright>You are welcome to share articles of Ivon's Blog (ivonblog.com). Please include the original URL when citing articles, and abide by CC BY-NC-ND 4.0 license. For commercial use, please write an e-mail to me.</copyright><lastBuildDate>Tue, 22 Nov 2022 16:02:46 +0800</lastBuildDate><atom:link href="https://ivonblog.com/en-us/tags/android-debug-bridge/index.xml" rel="self" type="application/rss+xml"/><item><title>Run ADB commands on your phone without a computer: Termux + ADB Wi-Fi wireless debugging</title><link>https://ivonblog.com/en-us/posts/termux-wireless-adb/</link><pubDate>Tue, 22 Nov 2022 16:02:46 +0800</pubDate><author>infoivonblog.nkfjt@aleeas.com (Ivon Huang)</author><guid>https://ivonblog.com/en-us/posts/termux-wireless-adb/</guid><description>&lt;!-- Co-translated by ChatGPT --&gt;
&lt;p&gt;&lt;strong&gt;This article only applies to devices running Android 11 or later. For devices below Android 11, please obediently use a computer for ADB debugging.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ADB (Android Debug Bridge) is a tool for debugging phones. Without root privileges, it can modify phone settings, such as installing/removing built-in apps, simulating tap events, transferring files, obtaining phone data, and so on.&lt;/p&gt;
&lt;p&gt;To run ADB commands, usually you have to connect the phone to a computer. Now Termux provides an ADB package, and with the wireless ADB feature built into Android 11 and later, you can do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Let an Android phone ADB-debug itself without using a computer.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Grant necessary system permissions to apps like Brevent, Ice Box, and Shizuku so they can function normally.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When connected to the same Wi-Fi, phone A can send ADB commands to phone B and control the other phone.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ADB with the Scrcpy app lets you control another phone, beating the hell out of any remote desktop.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;rsquo;s look at the concrete steps.&lt;/p&gt;

&lt;h2 class="relative group"&gt;1. Enable ADB wireless debugging
 &lt;div id="1-enable-adb-wireless-debugging" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#1-enable-adb-wireless-debugging" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;The location differs on every Android phone, so the following only covers the most common settings. ADB wireless debugging requires a Wi-Fi connection.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the phone&amp;rsquo;s system settings, scroll to the bottom, and find &amp;ldquo;About phone&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tap &amp;ldquo;Build number&amp;rdquo; 5 times to enable Developer options.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Return to the system settings home page and search for &amp;ldquo;Developer options&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In Developer options, check &amp;ldquo;ADB debugging&amp;rdquo; and &amp;ldquo;Wireless debugging&amp;rdquo;
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/ZV9g8Dr.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Always allow debugging on this Wi-Fi
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/Ob2YdKg.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tap into &amp;ldquo;Wireless debugging&amp;rdquo;, then press &amp;ldquo;Pair device with pairing code&amp;rdquo;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since the pairing-code dialog closes as soon as you leave it, you need to put the phone into &amp;ldquo;split screen&amp;rdquo;. Keep system settings on top and open the Termux app below, leaving the pairing-code dialog open.
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/Rmuzkqq.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 class="relative group"&gt;2. Install the ADB package in Termux
 &lt;div id="2-install-the-adb-package-in-termux" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#2-install-the-adb-package-in-termux" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Recommended reading first: &lt;a href="https://ivonblog.com/en-us/posts/how-to-use-termux/" target="_blank" rel="noreferrer"&gt;How to Use Termux&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open Termux and install the &lt;code&gt;android-tools&lt;/code&gt; package&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pkg install android-tools&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Confirm that the pairing-code dialog is still open, then enter the following command to start pairing and enter the six-digit Wi-Fi pairing code. Pairing only needs to be done once; this step is unnecessary afterward.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# [IP address] [port]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;adb pair 192.168.1.101:41733
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Enter the pairing code&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Enter the following command to connect. Note that the port here is the port shown under &amp;ldquo;Device name&amp;rdquo;; it is different from the one used for Wi-Fi pairing just now, and it changes after every reboot.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;adb connect 192.168.1.101:40505&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;ol start="4"&gt;
&lt;li&gt;
&lt;p&gt;The system will show that wireless debugging is connected
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/9HXAjl2.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At this point you can exit split screen. Use the &lt;code&gt;adb devices&lt;/code&gt; command to check whether the connection succeeded.
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/NcDe2y3.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now you can run ADB commands.
&lt;figure&gt;
 &lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt=""
 src="https://i.imgur.com/5dKcm3A.png"
 onerror="this.onerror=null;this.src='https://ivonblog.com/images/cannotloadimage.avif'"
 &gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 class="relative group"&gt;References
 &lt;div id="references" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#references" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.android.com/studio/command-line/adb" target="_blank" rel="noreferrer"&gt;Android Debug Bridge (adb) - Android Developers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.reddit.com/r/termux/comments/z1hmj0/phantom_process_killer_fixed_no_root_and_no/" target="_blank" rel="noreferrer"&gt;Phantom Process Killer FIXED no root and no computer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>