Giter Club home page Giter Club logo

Comments (23)

gdetra avatar gdetra commented on August 16, 2024 1

null
Exception in thread "main" java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at se.vidstige.jadb.JadbConnection.createTransport(JadbConnection.java:25)
at se.vidstige.jadb.JadbDevice.getTransport(JadbDevice.java:28)
at se.vidstige.jadb.JadbDevice.getState(JadbDevice.java:44)
at DeviceClass.main(DeviceClass.java:19)

from jadb.

SKART1 avatar SKART1 commented on August 16, 2024

Can you provide more information about regime in which adb is started?

Does adb devices show anything?
Is it real device or emulator?
What OS are you using?

from jadb.

gdetra avatar gdetra commented on August 16, 2024

i'm under Windows. When i run adb devices command ,it returns me my device with serial code.
mine is real device.
this is the java code that i'm using:

JadbConnection jadb = new JadbConnection();
JadbDevice device = jadb.getAnyDevice();
System.out.println(device.getSerial());
System.out.println(device.getState());

from jadb.

SKART1 avatar SKART1 commented on August 16, 2024

Can you try jadb.getDevices(); istead?

What are the error? NullPointerException - or just empty output

from jadb.

gdetra avatar gdetra commented on August 16, 2024

after adb start-server the exception is

null
Exception in thread "main" se.vidstige.jadb.JadbException: command failed: closed
at se.vidstige.jadb.Transport.verifyResponse(Transport.java:39)
at se.vidstige.jadb.JadbDevice.getState(JadbDevice.java:46)
at DeviceClass.main(DeviceClass.java:19)

from jadb.

gdetra avatar gdetra commented on August 16, 2024

any solutions?

from jadb.

gdetra avatar gdetra commented on August 16, 2024

With getDevices() now i can get serial number, but for state i have the same exception

from jadb.

SKART1 avatar SKART1 commented on August 16, 2024

Sorry I do not have windows host to test

You may try to debug actual response to determine what is the error

from jadb.

vidstige avatar vidstige commented on August 16, 2024

Interesting. The getAnyDevice addresses devices in a different way if I recall correctly. What is your adb version?

from jadb.

gdetra avatar gdetra commented on August 16, 2024

1.0.32 (adb version)

from jadb.

gdetra avatar gdetra commented on August 16, 2024

@vidstige any solutions?

from jadb.

vidstige avatar vidstige commented on August 16, 2024

@gdetra Alright, I've looked into this. I could not reproduce your problem with adb version 1.0.31 on Windows. Some question to help me troubleshoot this. I ran the RealDeviceTestCases.testListFilesTwice() test method and it works as expected. It calls the JadbConnection.getAnyDevice() method.

  • Are you using the maven package or do you have the source checked out. If you have the code checked out, can you please try to run the RealDeviceTestCases test suite?
  • What's your exact OS version?
  • What Android device(s) are you using to reproduce this?
  • Could you please try with adb 1.0.32 (just in case there is some protocol change in that version)

Thanks for your patience.

from jadb.

gdetra avatar gdetra commented on August 16, 2024

i'm using maven package. I use Windows 10 anniverasy update (Surface pro 4). My phone is a Xiaomi mi5.
i haven't trying with another device. i'm trying with testListFilesTwice()

from jadb.

gdetra avatar gdetra commented on August 16, 2024

@vidstige even with adb version 1.0.31 i have the same exception. How can i use realDeviceTestCases?

from jadb.

vidstige avatar vidstige commented on August 16, 2024

Hmm, that worked for me. The device should not matter in this case. Very strange indeed. It works on my Windows machine as I wrote before. Some more things you could try to help me get more information on this:

  • Can you try with an emulator? How does that work?
  • Check the adb daemon log (somewhere on the device) for any errors during this exception.

from jadb.

gdetra avatar gdetra commented on August 16, 2024

i have tried with an emulator and the result is the same. Can you tell me , @vidstige , how can i get this log? i have tried in tmp folder but i haven't found nothing. Help me please!

from jadb.

vidstige avatar vidstige commented on August 16, 2024

What version of jadb are you using? Can you try checking out latest master and see how it works there? Latest master works for me when I tested. As a workaround - Can't you just use jadb.getDevices()? What do you want to do?

  • The adb daemon log should be inside the regular logcat. E.g. try to run getAnyDevice and watch logcat output, note any errors and paste here.
  • Also try to run with latest master jadb as I have tested that and it works.

from jadb.

SKART1 avatar SKART1 commented on August 16, 2024

May be it is some firewall? Try to switch it at least for some time

May you try different PC/wire/phone?

from jadb.

gdetra avatar gdetra commented on August 16, 2024

@SKART1 i have tried but nothing to do. @vidstige i cannot find adb daemon log; if it is logcat i don't know how to show it.

from jadb.

gdetra avatar gdetra commented on August 16, 2024

@vidstige i have this version "number" because v1.1 give me cannot find error
94ebf38
I got it from here #14

from jadb.

vidstige avatar vidstige commented on August 16, 2024

Alright, so you cannot use the latest version in JitPack? So what I mean is, can you please try to git clone this repository and run the test from there?

from jadb.

SKART1 avatar SKART1 commented on August 16, 2024

@vidstige
Latest version is v1.0.1 - see jitpack

As for your problem - may be java programs run`s isn some kind of sandbox in latest windows OS?
You may try to dump traffic between:

  • adb client + adb server
  • jadb + adb server

to compare them. You can do it with wireshark

But I am sure this should not be so difficult =(

from jadb.

vidstige avatar vidstige commented on August 16, 2024

Closing this for now.

from jadb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.