Comments (2)
Additional information. The problem seems to stem from Electron or at least Electron's version of Node.js.
I'm digging into ADBkit connection code and noticed the following:
connect: ->
console.log "test"
@socket = new Net.Socket
@socket.setNoDelay true
@parser = new Parser @socket
@socket.on 'connect', =>
console.log "Connected"
this.emit 'connect'
@socket.on 'end', =>
this.emit 'end'
@socket.on 'drain', =>
this.emit 'drain'
@socket.on 'timeout', =>
this.emit 'timeout'
@socket.on 'error', (err) =>
this._handleError err
@socket.on 'close', (hadError) =>
this.emit 'close', hadError
@socket.connect @options
return this
If I remove the first console.log statement, the connection goes through fine and I see the "Connected" console.log message. If I keep it there, the connection is never made. This code is very timing sensitive for some reasons... can't figure out why yet
from adbkit.
This sample only ever works reliably in Electron if there is NO console.log statement in ADBKit code, which means there is a race condition somewhere. I admit the bug is probably not in ADBKit...
var adb = require("adbkit");
var util = require("util");
var Promise = require("bluebird");
try {
var Electron = require("electron");
} catch (e) {}
var main = function () {
//console.log("Creating ADB client");
adbClient = adb.createClient();
adbClient.trackDevices()
.then((tracker) => {
tracker.on("add", (device) => {
//console.log("Added: " + device.id);
Promise.join(
adbClient.getFeatures(device.id),
adbClient.getProperties(device.id),
(features, props) => {
console.log("Features: " + util.inspect(features));
console.log("Properties: " + util.inspect(props));
});
});
tracker.on("remove", (device) => {
console.log("Removed: " + device.id);
});
tracker.on("change", (device) => {
console.log("Changed: " + device.id);
});
tracker.on("error", (err) => {
console.log("Error: " + err);
});
});
};
if (Electron)
Electron.app.on("ready", main);
else
main();
from adbkit.
Related Issues (20)
- Log of Android 9 devices shows "data is unprocessable" HOT 2
- Can't use "bugreport xx.zip" with a mobile phone with adbkit HOT 4
- Add option to install APKs with all runtime permission granted automatically HOT 2
- Minicap and Minitouch in my personal project HOT 1
- Pushed file mode is not set successfully HOT 1
- sync.pull() HOT 1
- Please release a new version with #127 to npm HOT 3
- Error Unhandled rejection FailError: Failure: 'device still authorizing' HOT 2
- This project is no longer maintained HOT 1
- client .trackDevices() is not working HOT 2
- adb connect api issue
- sync mkdir
- install process
- Request node-forge version up
- use adbkit run shell auto stop
- @devicefarmer/adbkit@2
- "\"/system/bin/sh: echo 111: inaccessible or not found\\n\""
- I will run client.framebuffer is not working. HOT 1
- Calling cancel doesn't work on PullTransfer HOT 1
- Can this tool support the openharmony hdc
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 adbkit.