openstf / adbkit

A pure Node.js client for the Android Debug Bridge.
Other
831 stars 248 forks source link

Calling client.getProperties Returns Nothing #114

Closed brandonhenry closed 5 years ago

brandonhenry commented 5 years ago

I'm trying to call getProperties on the device id that I get from listDevices and it keeps returning an empty object. I also tried client.shell command with getProp as the argument, but I'm still not getting anything. There are no errors or anything, just nothing is coming back.

Any ideas?

The device is an Oculus Quest if that helps

issue-label-bot[bot] commented 5 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

sorccu commented 5 years ago

Run adb shell getprop and see if that returns anything.

Also, show your code.

brandonhenry commented 5 years ago

`export const getDevices = dispatch => { let deviceList = []

client.listDevices() .then(function(devices) { devices.map((device)=>{deviceList.push(device)}) }) .then(() => { deviceList.forEach((device) => { client.getProperties(device.id) .then((properties) => { console.log(properties) }) }) }) }`

(formatted: https://pastebin.com/CsueQfbs)

adb shell getprop returns values in the command line

sorccu commented 5 years ago

You’re not using promises properly. Do not use forEach, use Promise.map or similar. Just see the examples in the README. Also, check the same examples for the device list thing - you’re building your own list but you could’ve just used the original device list you received.