Comments (9)
Hey!
So this sounds really weird to me. I can't say that I have ever heard of an issue like that. Have you verified that you have setup your android sdk installation correctly?
What happens when you run adb devices
in the VSCode terminal? If it shows the same error then there is probably something wrong with your android platform tools installation.
from vscode-android-webview-debug.
@mpotthoff running adb devices
in vscode terminal lists the emulator and works fine, and Android SDK is included properly in the environment variables
from vscode-android-webview-debug.
Hmhhh. Weird. Have you tried setting the android-webview-debug.adbPath
configuration parameter to the exact location of adb executable just to go sure that nothing weird is going on with the PATH env variable? (preferably the same location reported by which adb
and type adb
)
from vscode-android-webview-debug.
@mpotthoff yes at first when I installed the extension I had to set this configuration parameter because I had this error failed to load adb executable
when I set it I got the error I mentioned after it. However, I managed to put android platform tools to my environment variables and I didn't need to set android-webview-debug.adbPath
myself.
from vscode-android-webview-debug.
Okay and just to go sure - You have also removed the parameter from your settings.json
again? (Just uninstalling and reinstalling won't remove the setting). Because the error can also be caused by an invalid path to the adb executable.
Otherwise you could also try running sudo chmod a+x <path-to>/adb
.
from vscode-android-webview-debug.
@mpotthoff yes I removed the parameter from settings.json
after including the path in my environment variables, I also gave the path executable permission using sudo chmod -R a+rwx <path-to>/adb
from vscode-android-webview-debug.
Okay. What happens when you create a script with the content
const child_process = require("child_process");
let outBuff = Buffer.alloc(0);
let errBuff = Buffer.alloc(0);
const process = child_process.spawn("adb", ["devices", "-l"]);
process.stdout.on("data", (data) => {
outBuff = Buffer.concat([outBuff, Buffer.from(data)]);
});
process.stderr.on("data", (data) => {
errBuff = Buffer.concat([errBuff, Buffer.from(data)]);
});
process.on("error", (err) => {
console.log("error");
console.log("err", err);
console.log("stdout");
console.log(outBuff.toString("UTF-8"));
console.log("stderr");
console.log(errBuff.toString("UTF-8"));
});
process.on("close", (code) => {
console.log("close");
console.log("code", code);
console.log("stdout");
console.log(outBuff.toString("UTF-8"));
console.log("stderr");
console.log(errBuff.toString("UTF-8"));
});
and run it with node in your terminal? What is the exact output? This is basically the same way I execute adb in the extension.
from vscode-android-webview-debug.
@mpotthoff This is the output I got:
close
code 0
stdout
List of devices attached
emulator-5554 device product:sdk_phone_x86 model:Android_SDK_built_for_x86 device:generic_x86 transport_id:3
stderr
from vscode-android-webview-debug.
I modified the process.on("error")
inside adb(options, ...args)
method in adb.js
to the following:
process.on("error", (err) => {
reject(new Error(JSON.stringify(options)));
});
in order to see the path printed and what I got is /Users/ramikh96/Library/Android/sdk/platform-tools
so it was missing /adb
. I tried adding the path again to the configuration parameter android-webview-debug.adbPath
as /Users/ramikh96/Library/Android/sdk/platform-tools/adb
but it also resulted in the same error. So what I did is I've put an if condition before const process = child_process.spawn(options.executable, [...options.arguments, ...args]);
to check if the path is missing /adb
and the extension worked just fine.
if (options.executable.split('/').pop() !== 'adb') {
options.executable = options.executable.concat('/adb');
}
UPDATE:
I found out that I added this path /Users/ramikh96/Library/Android/sdk/platform-tools
in User settings on vscode and I only removed the path in configuration from Workspace settings, so it seems that getting the configuration value was from User settings, so It was my fault not removing it from User settings as well.
from vscode-android-webview-debug.
Related Issues (10)
- How do I use webpack source maps in vscode debugger? HOT 2
- Chrome is not loading the website to debug HOT 1
- VS Code always says 'no devices found' HOT 5
- Multiple WebView Support HOT 1
- "cat: /proc/net/unix: Permission denied" after selecting device HOT 8
- Add to OpenVSX HOT 2
- breakpoints not being hit HOT 1
- WebView Search is finished before WebView is available HOT 2
- "Couldn't find a debug adapter descriptor for debug type 'android-webview' extension might have failed to activate)" HOT 6
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 vscode-android-webview-debug.