Android Kitkat imx6: How to use ABD over TCP by default

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Android Kitkat imx6: How to use ABD over TCP by default

1,644 次查看
bill123
Contributor III

On Mx6 Running kitkat android

Our design is not going to have the usb (otg) port available. I would like to set the adbd to use the tcp connections by default. I can get it to work but I have to restart adbd about reboot.

I have tried

root@nitrogen6x: # setprop persist.adb.tcp.port 5555

and added

system.adb.tcp.port=5555

/data/local.prop

    and/or

/system/build.prop

I can get adb to connect

         <sdk>\platform-tools> adb connect 172.16.0.45

ONLY if i restart adbd

root@nitrogen6x: # stop adbd

root@nitrogen6x: # start adbd

I don't under why this is required.. in system/core/adb/adb.c

I see

...

    // If one of these properties is set, also listen on that port

    // If one of the properties isn't set and we couldn't listen on usb,

    // listen on the default port.

    property_get("service.adb.tcp.port", value, "");

    if (!value[0]) {

        property_get("persist.adb.tcp.port", value, "");

    }

    if (sscanf(value, "%d", &port) == 1 && port > 0) {

        printf("using port=%d\n", port);

        // listen on TCP port specified by service.adb.tcp.port property

        local_init(port);

    } else if (!usb) {

        // listen on default port

        local_init(DEFAULT_ADB_LOCAL_TRANSPORT_PORT);

    }

I don't understand what is preventing it from starting correctly without adbd restart.

Any thoughts before I start ripping up the code :-)

标签 (2)
0 项奖励
回复
1 回复

793 次查看
haoranwang
NXP Employee
NXP Employee

Hi Bill,

     I suggest to modify the property on init.rc.

     You can simply added it in your device/fsl/platform_name/init.rc under "on boot" by "setprop service.adb.tcp.port 5555".

     Then "mm bootimage -B" to rebuild the boot.img. Burn boot.img into your board. Reboot.

     Thanks.

BRs,

Haoran

0 项奖励
回复