AndroidWiFiADB icon indicating copy to clipboard operation
AndroidWiFiADB copied to clipboard

Exception is thrown in intellij 15

Open athkalia opened this issue 10 years ago • 6 comments

Hello,

as soon as I click the wifi button I get this exception thrown:

String index out of range: -4
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
    at java.lang.String.substring(String.java:1955)
    at com.github.pedrovgs.androidwifiadb.adb.ADBParser.parseGetDeviceIp(ADBParser.java:71)
    at com.github.pedrovgs.androidwifiadb.adb.ADB.getDeviceIp(ADB.java:68)
    at com.github.pedrovgs.androidwifiadb.adb.ADB.connectDeviceByIp(ADB.java:56)
    at com.github.pedrovgs.androidwifiadb.adb.ADB.connectDevices(ADB.java:49)
    at com.github.pedrovgs.androidwifiadb.AndroidWiFiADB.connectDevices(AndroidWiFiADB.java:45)
    at com.github.pedrovgs.androidwifiadb.action.AndroidWiFiADBAction$1.run(AndroidWiFiADBAction.java:52)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

Seeing this in Intellij 15 EAP, v 143.379.11

athkalia avatar Oct 26 '15 14:10 athkalia

@athkalia which plugin version are you using? Can you try to execute this commands and paste the output here?

adb tcpip 5555
adb connect 192.168.2.131

Replace 192.168.2.131 with the IP assigned to your device.

Thanks!

pedrovgs avatar Oct 26 '15 20:10 pedrovgs

Hello,

I am using latest version, v1.2. When I use the commands it works fine and I get connected, I tried an over the air deployment and it succeeded. But once I disconnect and I am connected via USB again, if I click on your plugin button I get the very same exception

athkalia avatar Oct 27 '15 21:10 athkalia

Please, execute that commands and paste the result here. I need to check if there is something wrong with the output adb prints.

pedrovgs avatar Oct 28 '15 07:10 pedrovgs

adb tcpip 5555 restarting in TCP mode port:5555

then there's no cursor to continue writing. If I open a new command line to type the second command i get: adb connect 192.168.1.94 (my ip) connected to 192.168.1.94:5555

Then it works fine. Seems like there problem lies in the intellij plugin,
version of intellij is 143.747.6 (very latest 15 version)

athkalia avatar Nov 14 '15 21:11 athkalia

@athkalia can you try again with the latest version I've released?

pedrovgs avatar Dec 15 '15 10:12 pedrovgs

Hello

I can see the device connected in the new little window that you added for intellij. When I click on connect I get the message:

"Unable to connect device 'HTC_One_max' Review your WiFi connection"

note that if I hit

adb devices

in the terminal, my device is there, and i can deploy stuff to it just fine.

Also note that I have my wifi enabled on the phone and I can browse the internet just fine from it.

P.S. in the intellij plugin description, as far as the release notes are concerned it would be better if the latest version was at the top instead of the bottom.

athkalia avatar Dec 15 '15 19:12 athkalia