Search code examples
adbandroid-source

adb sync .. over wifi...?


I am developing an Android firmware, and I don't have a USB connection between the Linux machine and my board (the Linux machine I use is remote on my LAN, and I connect to it via SSH).

What my team is currently doing is mapping the android source directory (and OUT) as a Windows share, and the use fastboot flash *.img to flash the created images from windows.

I am used to use adb sync to sync the locally modified files to the device, but when you do this from windows /system/bin/sh will not get the executable bit (for example) and the board will fail to boot.

I was thinking of doing "adb sync" over the network from the remote linux server, is this possible?


Solution

  • According to a post on xda-developers, you can enable ADB over WiFi from the device with the commands:

    setprop service.adb.tcp.port 5555
    stop adbd
    start adbd
    

    And you can disable it and return ADB to listening on USB with commands:

    setprop service.adb.tcp.port -1
    stop adbd
    start adbd
    

    If you have USB access already, it is even easier to switch to using WiFi. From a command line on the computer that has the device connected via USB, issue the commands:

    adb tcpip 5555
    adb connect <ip_address_of_mobile_device>:5555
    

    To tell the ADB daemon return to listening over USB:

    adb usb
    

    EDIT: On newer Android versions you can set the listening from the settings menu. I did not test it with "sync" but "shell" and debugging work.