Page 1 of 1

Remote debugger: wifi only?

Posted: Wed Jan 26, 2022 7:50 pm
by trevix
I have the Pro Pack with the remote debugger, but i would like to know how does it communicate with my Mac.

I am developing in-App purchase for my App and ,off course, I have to take into account the fact that a user, who bought some services in-App, may be in the condition of not being connected to internet. (Some of my user have a tablet without SIM card and want to use the App in places where there is not Wifi).

In order to test my scripts, I wired my Andorid 7 phone with USB to the Mac.
Remote debugger works fine (the extension is loaded).

If I disable Wifi on the phone (that doesn't have a SIM card), I was assuming that the remote debugger would somehow work trough the USB cable, but this doesn't seem to be the case.

Do I understand it correctly?
Thanks
(version infos in my signature)

Re: Remote debugger: wifi only?

Posted: Thu Jan 27, 2022 6:10 pm
by jacque
Remote debugging works by opening a socket to the computer, and I don't think sockets work over a wired data connection. They are an internet protocol so you need wifi or ethernet.

Re: Remote debugger: wifi only?

Posted: Thu Jan 27, 2022 8:17 pm
by trevix
Too bad. If one is debugging socket communication the remote debugger may go in the way. After all the standalone is loaded,using the pro pack , via usb. Also Ethernet via usb is quite common (not on LC).
I wonder the reason of this choice

Re: Remote debugger: wifi only?

Posted: Fri Jan 28, 2022 7:30 pm
by jacque
It might, but the remote debugger uses only one specific port so unless your app specifies that one it should be okay. I did see one report of a conflict a while ago but it's rare. I can't recall the actual port number, sorry, but it's static and doesn't change.

Re: Remote debugger: wifi only?

Posted: Fri Jan 28, 2022 9:53 pm
by FourthWorld
trevix wrote:
Thu Jan 27, 2022 8:17 pm
Too bad. If one is debugging socket communication the remote debugger may go in the way. After all the standalone is loaded,using the pro pack , via usb. Also Ethernet via usb is quite common (not on LC).
I wonder the reason of this choice
If your computer is set up to use Ethernet for networking I would be surprised if LC cares.

Have you experienced a conflict between the remote debugger and your networking code?

Re: Remote debugger: wifi only?

Posted: Sat Jan 29, 2022 10:10 am
by trevix
Well, my standalone in some user case, must connect to the hotspot of another device.
So in order to test this, I have to connect the Mac WiFi to the hotspot of the second device and I guess my remote debugger wont work.
But I haven't tested this yet.

Also, I have to do error handling for when the phone is not connected to internet wifi (for in-app purchase, for sending data to my server, etc.)

Re: Remote debugger: wifi only?

Posted: Sat Jan 29, 2022 6:13 pm
by jacque
Let us know how it goes after you test, I'm curious.

Re: Remote debugger: wifi only?

Posted: Wed Feb 02, 2022 12:03 pm
by trevix
Testing remote debugger using a HotSpot WiFi device:
iPhone is plugged to USB of Mac but its WiFi is connected to a third hardware in hotspot mode.
Remote debugger on Mac doesn'start.

Re: Remote debugger: wifi only?

Posted: Wed Feb 02, 2022 9:16 pm
by jacque
Remote debugging is supposed to work whether or not the device is connected to a computer, and it's supposed to work in standalones too. Try uncabling the phone from the Mac, and see if it works that way.

I assume you can use remote debugging with a normal connection, right? Not all LC editions support remote debugging.

Re: Remote debugger: wifi only?

Posted: Thu Feb 03, 2022 11:12 am
by trevix
I have the LC Pro-Pack, in order to do remote debugging. I believe that remote debugger must work either via WiFi or via usb wiring.
No other ways that I know of. (I don't think it can work using the cell data).
I was hoping that it could also use the USB wiring, instead of WiFi, but it doesn't.

So, these are my tests, done with an iPhone and a Mac both connected to the hotSpot WiFi of a TvBox.
The Mac has both ethernet and Wifi.
The standalone has just a "breakpoint" on the PreOpenStack.


1) iPhone usb wired, connected to TvBox hotspot, Remote debugger extension=off, script debug mode= on:
I can run the standalone using test in LC, but the remote debugger does not run

2) iPhone usb wired, connected to TvBox hotspot, Remote debugger extension=on, script debug mode= on:
I can run the standalone using test in LC, but the remote debugger does not run. On launch, the standalone actually does a long wait, as if it was searching, then give up and run normally.

3) if the iPhone has WiFi disabled, no remote debugging: the standalone freezes on launch for at least 20 seconds.

Connecting both the iPhone and the Mac to the router wifi, the remote debugger works.

And anyway,

I think the LC dictionary should state that remote debugger works only when the WiFI of both the Phone and the Mac devices are on the router WiFi.
Am I missing something?

Re: Remote debugger: wifi only?

Posted: Thu Feb 03, 2022 9:08 pm
by jacque
The first two tests will be the same because the remote debugger is always included in a standalone that is created via a cabled phone with the Test button. The only time the builder honors the remote extension setting is if you build a standalone to the desktop and you have specifically included it in the Inclusions pane.

I'm not sure what else to say since I don't know how remote debugging works exactly. I suppose you could try building a standalone to the desktop and then installing it on the phone. Be sure to specifically include the remote debugger inclusion, and don't have the phone attached to the computer. But do have both the computer and the phone connected to the hotspot.

Re: Remote debugger: wifi only?

Posted: Thu Feb 03, 2022 10:37 pm
by trevix
Yes by, in point of view, what matters is not the hotspot.
I would like to remote debug a socket script that uses WiFi and must handle the case were there is not a WiFi available (users often don't know about and, like for some tablet, they may not have a data cell line)

Re: Remote debugger: wifi only?

Posted: Fri Feb 04, 2022 9:20 pm
by jacque
The most common way to check for wifi is to put a tiny text file on your server and see if the app can retrieve it.

Re: Remote debugger: wifi only?

Posted: Tue Mar 29, 2022 11:59 am
by trevix
Still struggling with sockets debugging on mobile.

Whenever there is a cleanup of "opensockets", the remote debugger goes off line.
Is there a way to find out wich socket the remote debugger is using, so that I don't close it?
Something like this:

Code: Select all

 repeat for each line TheSocket in the OpenSockets
          if ":" is in TheSocket AND IPofRemoteDebugger is not in TheSocket then --don't close the socket used by the remote debugger
               close socket TheSocket
          end if
end repeat
I tried with the networkInterfaces, but it does not seem to include an extra IP.
Thanks for any help
Trevix