Using ADB instead of WiFi for editing

1,584 views
Skip to first unread message

Dave Smart

unread,
Apr 15, 2015, 5:37:22 AM4/15/15
to androi...@googlegroups.com
Hi Guys,

If you want to try out the ADB editing option, you need to do the following things:-

- Enable the 'Use ADB' option in DroidScript settings.
- Enable developer mode in your Android device.
- Turn on USB debugging.
- Plug your device into a USB port.
- Install the USB drivers for your device (Windows will find many device drivers automatically for you).
- On Windows:- install and run 'DroidScript Connect' found here:-  http://androidscript.org/adb  (it includes ADB)
- On other platforms:- you will need to install ADB and enable ADB forwarding using the following ADB command:-  adb forward tcp:8088 tcp:8088
- Type 127.0.0.1:8088 into your browser address bar
- You should now be editing via USB :)

Note: If you have trouble with the drivers and connectivity, you might want to create a little batch file with the adb forward command in it and a 'pause' command after it so that you can see what the ADB error messages are like this:-

adb forward tcp:8088 tcp:8088
pause

Jem Easom

unread,
May 13, 2016, 3:22:40 AM5/13/16
to DroidScript
Dave,
Does this method still work? I'm not having any luck with my shiny new Win 10 laptop, trying to get it to talk to my phone.

Notably, when I run that batch file test line, it tells me that adb isn't a recognised command, program or batch file.

Any pointers?

Thanks.

Dave Smart

unread,
May 13, 2016, 4:46:20 AM5/13/16
to DroidScript
Hi Jem,

Yes it still works, I use it all the time. 

Did you install the ADB drivers for your phone properly?

Also, it may be your firewall that is blocking the connection. You might need to allow DroidScript Connect through your firewall.

You could try the batch file thing with the full paths to adb.exe and see what happens.

Jem Easom

unread,
Jun 7, 2016, 4:45:48 PM6/7/16
to DroidScript
Okay, let's see.

I have installed and reinstalled and reinstalled the device drivers for my HTC One. 

I have created a batch file to forward the port 8088, which apparently does nothing

I have created a batch file to list ADB devices and it shows none.

Disabling my firewall has no effect on any of this.

Is there any indicator that Droidscript Connect has even run successfully? I double click on it and nothing really happens.

I have absolutely no idea why this isn't working.

Jem Easom

unread,
Jun 7, 2016, 5:28:06 PM6/7/16
to DroidScript
Correction: Droidscript Connect loads and hides itself immediately in the system tray - upon right clicking and selecting connect, it says "Device not found!"

Device is not lost, however. Device is physically touching my laptop, however one resists all efforts to talk to the other.

I'm on Windows 10, for what that's worth, and having no luck whatsoever.

Dave Smart

unread,
Jun 8, 2016, 5:38:34 AM6/8/16
to DroidScript
When you turned on USB debugging on your phone's developer options, did you get a prompt about accepting authorizations?

If not, then you might need to choose the option to revoke USB debugging options and try again.

Also... get you get a list of connected devices from ADB at the command prompt using the 'adb device' command?

Jem Easom

unread,
Jun 8, 2016, 5:51:01 AM6/8/16
to DroidScript
I got lucky and solve this just a moment ago - quite nice really as I'm about to get on a Eurostar so I can get a few hours coding done :D

I didn't get a list of devices at all previously, in the end a combination of various solutions here got me over the line. Basically revoking all previous permissions and reinstalling HTC One drivers for the umpteenth time.

Time to get cracking on some coding!

Richweb

unread,
Oct 30, 2017, 5:24:27 AM10/30/17
to DroidScript
Cool!!

Virtuos86

unread,
Dec 2, 2017, 3:51:59 PM12/2/17
to DroidScript
I'm using on Linux this instruction composed by Warren Downs:

Virtuos86, what Linux distribution do you use? Both WIndows and Desktop-oriented Linux distributions like Ubuntu will automatically treat the Android device as a network connection, if it is plugged in via USB as a "Media Device" and you use Android's USB tethering mode. Then you don't need to mess with ADB settings on Linux (or Windows). But you do still have to check "Use ADB" in the DroidScript settings, and connect from a Linux browser to the router address assigned, port 8088.

If you already have ADB set up that may be easier for you, but if not, try the following (Detailed instructions):
1. Plug in Android device to Linux computer via USB.
2. Make sure Media Device is the mode being used.
3. In Android Settings | Wireless and Networks | Tethering & Portable Hotspot, check "USB tethering".
4. In Linux, at the command line, type "route -n' and you should see a new gateway listed, for example "192.168.42.129". This is the address of the Android device as seen from Linux. (It should stay the same every time you plug in).
5. In Android, start DroidScript, go to Settings, and check "Use ADB".
6. Also in DroidScript, click the "up" arrow to the left of the Droid icon. An "ADB Connect" dialog should appear and tell you to navigate to 127.0.0.1:8088 in a browser. You could do that using ADB, but since we're using USB tethering, you can instead:
5. In a Linux browser, navigate to http://192.168.42.129:8088 (or whatever address you saw for the gateway in step #4).

It works fine for me.

Virtuos86

unread,
Dec 2, 2017, 3:57:08 PM12/2/17
to DroidScript
Note
"up" arrow
in the newest DroidScript versions changed to WiFi icon.

Jared

unread,
Feb 8, 2022, 9:13:18 AM2/8/22
to DroidScript
Hi @dave and others,

This method works for me to use the IDE over usb/adb, however several of the extensions (filebrowser/console/etc) don't seem to connect due to host refusal to connect (probably due to being over localhost).

Is there any way to resolve this in chrome with a flag or something with modifying CORS settings?

Thanks
Jared

Dave

unread,
Feb 10, 2022, 9:43:07 AM2/10/22
to DroidScript
I'm not sure DroidScript connect opens enough ports for all the newer features of DS.  You try editing the main.js script in the Program Files/DroidScript Connect/ folder so it matches this - 

adb forward tcp:8088 tcp:8088
adb forward tcp:8889 tcp:8889
adb forward tcp:3000 tcp:3000

or simply create a batch for shell script with these commands in it.

Jared

unread,
Feb 18, 2022, 1:34:28 PM2/18/22
to DroidScript

Thanks @Dave that worked!! 

The only thing is that I wasn't able to find where to modify that main.js file, so I just modified the Forward.bat script instead to include the additional ports. 

I guess it doesn't really matter though...I can just make a script that runs Droidscript connect and executes the ADB Commands all in one go anyways :-) 
Message has been deleted

Jared

unread,
Feb 18, 2022, 1:51:33 PM2/18/22
to DroidScript

@Dave

So I was able to modify the Main.js file to make all the extensions work. (Note that for me the file I changed was located at: `C:\Program Files (x86)\Droidscript\Main.js`) 

I attached the new Main.js file if you decide you want to update it on the androidscript.org site or something

Seems like now if I run the DroidScript Connect app it automatically forwards all three ports ( I made sure to quit all instances of ADB and kill the servers running before testing it, as to know if it really worked or not)



Main.js.txt
Reply all
Reply to author
Forward
0 new messages