Network service discover

106 views
Skip to first unread message

Zabir Hakim

unread,
Jan 28, 2024, 6:55:04 AM1/28/24
to Automate for Android
Hey there, hope you're well.

Automate has been an absolutely amazing tool so far. Unfortunately, recently I've come across a problem I'm unable to work around or figure out.

I am trying to use to the "Network service discover" block to obtain the current adb connected port, but the block isn't returning anything. I've tried selecting all the services to determine if the block actually works but it returns nothing on the network. It seems as though the block isn't working or it doesn't do anything?

Any help is much appreciated.

Thanks,
Z.

Zabir Hakim

unread,
Jan 28, 2024, 7:01:30 AM1/28/24
to Automate for Android
Just to add to the opening query.

All I really need is the ability to automate the "Restart ADB in TCP mode" option somehow within the flow. When clicking this setting, Automate is clearly able to discover the adb tcpip port and set it to 5555, so there must be a way to do this in the flow via some command?

Thanks again,
Z.

Henrik "The Developer" Lindqvist

unread,
Jan 28, 2024, 7:12:44 AM1/28/24
to Automate for Android
Ensure to Service type is set to Android Debug Bridge (ADB) over TLS, i.e. "_adb-tls-connect._tcp"
Ensure the "Wireless debugging" option is enabled in system Developer settings.

Zabir Hakim

unread,
Jan 28, 2024, 7:19:28 AM1/28/24
to automa...@googlegroups.com
You're a superstar Henrick, thanks for that, it worked.

I assumed debugging was always on because my other flows actually enable it, but I was doing an isolated test for this so it skipped the step where wireless debugging is enabled, hence it didn't work.

P.s. out of curiosity, does Automate use the same mechanism to enable tcpip on port 5555 using the setting "Restart ADB in TCP mode" or does it do it differently?

Thanks,
Z.

--
You received this message because you are subscribed to the Google Groups "Automate for Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/ad5b6706-cc2c-47e0-80ff-4bbe17e2d14fn%40googlegroups.com.

Zabir Hakim

unread,
Jan 28, 2024, 10:19:56 AM1/28/24
to automa...@googlegroups.com
Hi again Henrick,

Sorry issue here with the Network service discover block, it doesn't always return the port, I have to disable and enable wireless debugging to get it to work again but then it's intermittent.

Any suggestions?

Henrik "The Developer" Lindqvist

unread,
Jan 28, 2024, 4:11:22 PM1/28/24
to Automate for Android
That's how it works, it seems the service is only discoverable for a while after "Wireless debugging" has been enabled, or possibly after connecting to a Wi-Fi network.

"Restart ADB in TCP mode" option in Automate settings, the ADB protocol set block and executing adb tcpip 5555 does indeed to the same thing.

Zabir Hakim

unread,
Jan 28, 2024, 4:16:02 PM1/28/24
to automa...@googlegroups.com
Thank for you reply Henrik. I discovered that the using the "Shell command" block addresses my issue, no need to use "ADB shell command" block, this way I don't need to know the port and everything works like a treat.

Thanks a lot.

Z.

Reply all
Reply to author
Forward
0 new messages