<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Divyam Ojas</title>
    <description>The latest articles on DEV Community by Divyam Ojas (@divyamojas).</description>
    <link>https://dev.to/divyamojas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F823784%2F008d2a31-0896-4b38-8bac-73ef6aa5daee.jpeg</url>
      <title>DEV Community: Divyam Ojas</title>
      <link>https://dev.to/divyamojas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/divyamojas"/>
    <language>en</language>
    <item>
      <title>With Broken USB Cable, How to Debug the App: Wireless Connect 😏</title>
      <dc:creator>Divyam Ojas</dc:creator>
      <pubDate>Wed, 28 Sep 2022 17:51:09 +0000</pubDate>
      <link>https://dev.to/divyamojas/with-broken-usb-cable-how-to-debug-the-app-wireless-connect-p06</link>
      <guid>https://dev.to/divyamojas/with-broken-usb-cable-how-to-debug-the-app-wireless-connect-p06</guid>
      <description>&lt;p&gt;You are working nonstop to be promoted to Senior App Developer for months and this app project is the ladder to take you a step closer to it. But at the last moment, you broke your ladder. Goddd! Why me?? Sings in a corner &lt;em&gt;"Give me some sunshine, give me some rain, give me another chance I wanna buy a USB cable once again"&lt;/em&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Why not use Virtual Device? 🤔
&lt;/h2&gt;

&lt;p&gt;Developing an app on a low-end laptop is truly annoying. There is already low RAM, and now you have to allocate some for the virtual device, thus making us stare at &lt;strong&gt;(Not Responding)&lt;/strong&gt; added to the window title more than actually coding. We can’t just keep wasting our time like this, right? Especially when the project deadline is close and other clients keep nudging you to finish their projects. So we opt to connect our mobile phones with a USB cable and run the app on them. But this brings us to another problem! &lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Problem With Using Cables? 🤯
&lt;/h2&gt;

&lt;p&gt;Managing the cables and wires and wires and some more wires while working is a big headache. There is the charger cord, a wired keyboard, a wired mouse, your Wi-Fi dongle and maybe some other indispensable device, and then your mobile device to run the simulation. Product designers, following the "&lt;em&gt;less is more&lt;/em&gt;" mantra, are ruthlessly reducing the number of ports on a laptop now. Dude, &lt;em&gt;less is more&lt;/em&gt; for design, not functionality!!&lt;/p&gt;

&lt;p&gt;Now there are fewer and fewer ports and more and more devices to connect to. Facing this crisis, we can do nothing but sacrifice for the greater good, especially when I am the chosen one and my laptop’s USB port/cable stops working (your name will be remembered in some GitHub repositories).&lt;/p&gt;

&lt;h2&gt;
  
  
  I wish I could connect my device without any cables! 🙏🏻
&lt;/h2&gt;

&lt;p&gt;Did I accidentally rub a genie lamp or what? There is actually a way to do wireless debugging! &lt;/p&gt;

&lt;p&gt;I should have wished for my Hogwarts Invitation Letter instead!&lt;/p&gt;

&lt;p&gt;While browsing through the developer options on my newly bought phone😌, I came across a new option… Wireless Debugging! Now I don't have to open the Amazon app to order a USB cable anymore. ✌️&lt;/p&gt;

&lt;h2&gt;
  
  
  Okay, so how do we Debug ‘&lt;em&gt;Wirelessly&lt;/em&gt;’? 😌
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First of all, you have to turn on developer options. Go to &lt;strong&gt;About Phone &amp;gt; Version&lt;/strong&gt; and click on “&lt;em&gt;Build Number”&lt;/em&gt; 7 times. &lt;em&gt;Woohooo&lt;/em&gt;! You're a developer now!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iDj43mx1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kbk97bfgkm8q3kegc0o.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iDj43mx1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0kbk97bfgkm8q3kegc0o.jpeg" alt="Turn On Developer options" width="880" height="1129"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now &lt;strong&gt;Connect your device&lt;/strong&gt; to your laptop with a USB cable and select &lt;em&gt;file transfer mode&lt;/em&gt; ( while initializing for the first time, you still need a USB cable😞, but just for the first time and no more 😃).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jKVX-2nk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qibv7n2t2bj3uvcszqw0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jKVX-2nk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qibv7n2t2bj3uvcszqw0.png" alt="USB cable" width="220" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Make sure both your devices are connected to the &lt;strong&gt;same Wi-Fi network&lt;/strong&gt; and ARE &lt;strong&gt;DISCOVERABLE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You can &lt;strong&gt;ping your device&lt;/strong&gt; to confirm it. Enter your mobile’s IP Address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To &lt;strong&gt;find your device's IP address&lt;/strong&gt;, you can simply click on &lt;em&gt;Wireless Debugging&lt;/em&gt; or go to &lt;strong&gt;About Phone &amp;gt; Status.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ping&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;192.168.x.xxx&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vCvGsStY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkgxzh9n3jpi4lzjqke9.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vCvGsStY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkgxzh9n3jpi4lzjqke9.jpeg" alt="Ping mobile IP response" width="720" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yayyy!! We are connected now.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now go to developer options and &lt;strong&gt;turn on *USB Debugging&lt;/strong&gt;* and allow debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Turn on Wireless debugging&lt;/strong&gt;, and a pop-up will appear asking you to confirm the network and device ID. Click "Allow.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BIjh3qsb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ur9t9dhfk8hak0ogwnp.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BIjh3qsb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ur9t9dhfk8hak0ogwnp.jpeg" alt="Turn on USB Debugging and Wireless Debugging" width="880" height="965"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now &lt;strong&gt;open your terminal&lt;/strong&gt; and navigate to the folder containing &lt;strong&gt;&lt;em&gt;adb.exe&lt;/em&gt;&lt;/strong&gt; in &lt;strong&gt;&lt;em&gt;Android SDK platform tools.&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;If you don't know the &lt;strong&gt;&lt;em&gt;adb.exe&lt;/em&gt;&lt;/strong&gt; file location, Open &lt;strong&gt;Android Studio&lt;/strong&gt;, &lt;strong&gt;Tools &amp;gt; SDK Manager&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ1cDG64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--s2SpjJx5--/c_limit%252Cf_auto%252Cfl_progressive%252Cq_auto%252Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86as35m6jwr4ync3b6vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ1cDG64--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--s2SpjJx5--/c_limit%252Cf_auto%252Cfl_progressive%252Cq_auto%252Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86as35m6jwr4ync3b6vt.png" alt="Open SDK Manager" width="646" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy the &lt;strong&gt;&lt;em&gt;Android SDK location&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pmst3Ahy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--IgFc1DdU--/c_limit%252Cf_auto%252Cfl_progressive%252Cq_auto%252Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13vxxc22221ja8oen725.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pmst3Ahy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--IgFc1DdU--/c_limit%252Cf_auto%252Cfl_progressive%252Cq_auto%252Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13vxxc22221ja8oen725.png" alt="Copy Android SDK location" width="880" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Android SDK platform tools&lt;/strong&gt; in the terminal.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;C:\Users\91825\AppData\Local\Android\Sdk\platform-tools&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--na0UxLUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1oa22t2ozupn18gpj5oa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--na0UxLUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1oa22t2ozupn18gpj5oa.png" alt="Navigate to platform tools" width="880" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, &lt;strong&gt;kill the current server&lt;/strong&gt; to avoid issues because of the running server.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;kill-server&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fPblMcH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldoixqkqz99ntp43a7l4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fPblMcH---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldoixqkqz99ntp43a7l4.png" alt="ADB kill server" width="880" height="71"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see another pop-up on your device to allow debugging. Click "Allow.”&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next, set the debugging port to &lt;strong&gt;5555&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;tcpip&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;5555&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DOsMCLlc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jo9x5wmm4gncwb1hkor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DOsMCLlc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jo9x5wmm4gncwb1hkor.png" alt="adb tcpip 5555" width="880" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once again, click allow on the popup on your device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The next and final step is to &lt;strong&gt;connect&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;192.168.x.xxx&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dUxBsBP5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znfkgiipww7nextg1qdi.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dUxBsBP5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znfkgiipww7nextg1qdi.jpeg" alt="Connect the device" width="880" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; When you click enter it will prompt &lt;em&gt;failed to authenticate&lt;/em&gt;. Worry not my friend, once you allow the popup on your device, and repeat the same command, it will say &lt;em&gt;already connected.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now you can 'dis-entangle' your USB cable and put it back into your drawer. You are all set to work now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s catch up for a beer 🍻
&lt;/h3&gt;

&lt;p&gt;Connecting devices wirelessly reduces the hassle of managing wires and also saves us a lot of time as we don’t have to use virtual devices. Now that we've got spare time on our hands, let’s use it for another project, or maybe connect on &lt;a href="https://www.linkedin.com/in/divyamojas/"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; I've tested this method for Windows + Android Mobile, will this work for Linux + Android too? Or Windows + iOS?  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you run an organization and want me to write for you, please do connect with me. 😃&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>android</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
