Open GoogleCodeExporter opened 9 years ago
[deleted comment]
[deleted comment]
[deleted comment]
In order to eliminate this error, I would suggest this one line change, but it
might expose others afterwards:
ORIGINAL CODE:
private void connectToAgent() {
for (int i = 0; i < 10; i++) {
try {
s = new Socket("127.0.0.1", PORT);
break;
} catch (Exception s) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
return;
}
}
}
System.out.println("Desktop => device socket connected");
screencapture.start();
try {
os = s.getOutputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
MODIFIED CODE:
private void connectToAgent() {
for (int i = 0; i < 10; i++) {
try {
s = new Socket("127.0.0.1", PORT);
break;
} catch (Exception s) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
return;
}
}
}
System.out.println("Desktop => device socket connected");
screencapture.start();
try {
// Eliminate null exception
if (s != null)
os = s.getOutputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Original comment by aiprag...@gmail.com
on 1 Nov 2011 at 8:25
Downloaded source through git;
Installed Eclipse Classic;
Added ADT plugin;
Imported AndroidScreencast project;
Ran it debug mode;
It generated the following error which the standalone app does not generate the
top four lines;
53:40 E/adb-forward: Device rejected command: unknown host service
java.io.IOException: Device rejected command: unknown host service
at com.android.ddmlib.AdbHelper.createForward(AdbHelper.java:513)
at com.android.ddmlib.Device.createForward(Device.java:302)
at net.srcz.android.screencast.api.injector.Injector.init(Injector.java:157)
at net.srcz.android.screencast.api.injector.Injector.access$0(Injector.java:155)
at net.srcz.android.screencast.api.injector.Injector$1.run(Injector.java:26)
I searched the web for "Device rejected command: unknown host service" and
found the following website:
https://wiki.linaro.org/Platform/Android/AndroidScreencast
It talked about using adb through USB and ethernet, but ethernet you have to
set the environment variable ADBHOST=IP (Ethernet's DHCP IP)
I did the same thing for "ADB over wireless", and it worked.
The code changes I suggested in the previous comment...I would not follow
through with, because what happens is that the exception (error) is not
generated, and what it comes back with in debug mode is "Injector is not
running yet...".
As far as I'm concerned this is no longer an issue.
Original comment by aiprag...@gmail.com
on 1 Nov 2011 at 8:27
Original issue reported on code.google.com by
aiprag...@gmail.com
on 30 Oct 2011 at 12:18Attachments: