Remote debugger: wifi only?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Remote debugger: wifi only?

Post by trevix » Wed Jan 26, 2022 7:50 pm

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)
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Thu Jan 27, 2022 6:10 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » 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
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Fri Jan 28, 2022 7:30 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9083
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Remote debugger: wifi only?

Post by FourthWorld » Fri Jan 28, 2022 9:53 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » Sat Jan 29, 2022 10:10 am

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.)
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Sat Jan 29, 2022 6:13 pm

Let us know how it goes after you test, I'm curious.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » Wed Feb 02, 2022 12:03 pm

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.
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Wed Feb 02, 2022 9:16 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » Thu Feb 03, 2022 11:12 am

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?
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Thu Feb 03, 2022 9:08 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » Thu Feb 03, 2022 10:37 pm

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)
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6536
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Remote debugger: wifi only?

Post by jacque » Fri Feb 04, 2022 9:20 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

trevix
Posts: 730
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Remote debugger: wifi only?

Post by trevix » Tue Mar 29, 2022 11:59 am

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
Trevix
OSX 10.15.7 xCode 12.4 LC 9.6.6stable iOs 14.4.2> Android 7>

Post Reply

Return to “Android Deployment”