Comments (23)
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.
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.
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.
Can you try jadb.getDevices();
istead?
What are the error? NullPointerException - or just empty output
from jadb.
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.
any solutions?
from jadb.
With getDevices() now i can get serial number, but for state i have the same exception
from jadb.
Sorry I do not have windows host to test
You may try to debug actual response to determine what is the error
from jadb.
Interesting. The getAnyDevice
addresses devices in a different way if I recall correctly. What is your adb version?
from jadb.
1.0.32 (adb version)
from jadb.
@vidstige any solutions?
from jadb.
@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.
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.
@vidstige even with adb version 1.0.31 i have the same exception. How can i use realDeviceTestCases?
from jadb.
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.
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.
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.
May be it is some firewall? Try to switch it at least for some time
May you try different PC/wire/phone?
from jadb.
@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.
@vidstige i have this version "number" because v1.1 give me cannot find error
94ebf38
I got it from here #14
from jadb.
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.
@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.
Closing this for now.
from jadb.
Related Issues (20)
- executeShell only executes command when input i HOT 2
- .executeShell doesn't work with large commands and multiple arguments HOT 2
- Could you make a new release, please? HOT 3
- Last modified time isn't propagated to the device properly when pushing HOT 1
- SELinux is blocking apk install from /sdcard/* HOT 1
- Trying to connect android with android HOT 3
- execute command not working with mutated vowels (german umlaute) HOT 6
- Provide deterministic module name for Java 9 module support HOT 4
- iOS version for this library or similar HOT 4
- RemoteFile.getPath() doesn't work as intended? HOT 1
- Do I need to manually close any connections or devices? HOT 2
- How does the server module work? HOT 1
- screencap not pulling and working HOT 1
- Is it possible to support exec-out ? HOT 1
- Dependency 'com.github.vidstige:jadb:v1.2.1' not found HOT 4
- device state change offline HOT 1
- java.io.EOFException HOT 1
- Screencap is generating corrupted PNG files HOT 1
- How to detect symbolic link and permissions in RemoteFile HOT 1
- JadbDevice.pull() doesn't work using files from list() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jadb.