Showing posts with label android studio. Show all posts
Showing posts with label android studio. Show all posts

Monday, 17 October 2016

  Connecting android studio to adb using network in OS X


I am using android studio for the past 2 year. The Major thing which worried me while testing the application is connecting the android device to the laptop through usb cable.
Then one day i came to know through my friend that we can run our app from android studio on the device through network like wifi connectivity, etc.
I did the following things to connect the adb through network in OSX operating system:
  1. First i added the path variable for adb using the following commands: Echo your export command and redirect the output to be appended to .bash_profile file and restart terminal. (have not verified this but should work)                                                                                              echo "export PATH=$PATH:/Users/username/Library/Android/sdk/platform-tools/ sdk/platform-tools/" >> ~/.bash_profile 
  2. Then i checked whether the path is set by using the cmd                                                                adb version 
        and it returned
        Android Debug Bridge version 1.0.36
        Revision 19394af606f6-android

      3.Then i used the following command
           adb tcpip 5555
           5555 is the port no at which the adb will connect
       it returned
       restarting in TCP mode port : 5555
  
     4.Then i noted the ip of my android device which is connected in the same network in which my        mac is connected.
     5.then i used the following cmd to connect the device
       adb connect 192.168.#.#
      where 192.168.#.# is the ip of my android device
      then it returned
      connected to 192.168.#.#
 
    6.And finnaly you can find your android device in your connected devices list in android studio

hope this article is helpful for you.comments are welcomed.