You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone, I recently started trying out the demo web app. However, when I attempted to use spawn instead of shell, I encountered the following error:
Error: Socket open failed
at AdbPacketDispatcher.handleClose (dispatcher.ts:172:1)
at Object.write (dispatcher.ts:94:1)
Here is the modified code, where the code snippet below is placed inside an onClick function for a button:
GLOBAL_STATE.device.subprocess.dispose();// shell works fineGLOBAL_STATE.device.subprocess.shell().then(action((shell)=>{// terminal!.socket = shell;console.log("shell:",shell);}),(e)=>{console.log(e);});GLOBAL_STATE.device.subprocess.dispose();// but I'm not able to `spawn` a command and get the returned outputGLOBAL_STATE.device.subprocess.spawn(`ls`).then(action((spawn)=>{console.log("spawn:",spawn);}),(e)=>{console.log(e);});
Could someone please review my use of spawn and confirm if it is correct? If not, what is the correct way to use it?
My intention is quite simple: I want to execute a command such as ls -l or ifconfig and obtain the stdout and stderr outputs. I am using the default global.ts as a template.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I recently started trying out the demo web app. However, when I attempted to use
spawninstead ofshell, I encountered the following error:Here is the modified code, where the code snippet below is placed inside an onClick function for a button:
Could someone please review my use of spawn and confirm if it is correct? If not, what is the correct way to use it?
My intention is quite simple: I want to execute a command such as
ls -lorifconfigand obtain thestdoutandstderroutputs. I am using the defaultglobal.tsas a template.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions