admin管理员组文章数量:1336710
Following the react native documentation, i just created my first react-native app (just npx react-native init AwesomeProject no changes).I also added the enviromentalpath: C:\Users\thijs\AppData\Local\Android\Sdk\platform-tools named ANDROID_HOME under uservariables. But when i try to run my code i get an error
Stack: Error: Failed to run the application in Android (error code 104):
Error while executing mand 'adb devices': Command failed: adb devices
'adb' is not recognized as an internal or external mand,
operable program or batch file.
at Function.getWrappedError (c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:152489)
at Function.wrapError (c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:13533)
at c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:203519
at processTicksAndRejections (internal/process/task_queues.js:97:5)
When i open cmd and go to the exact location where adb.exe is installed adb device works but when in do it in any other location it won't work
I've tried reinstalling android studio... No results. I've looked at other stackoverflow questions but no one seemed to have the exact same error as mine(i tried they're sollutions but no results).
This is my first time posting here if you need any additional information please ask. Thanks in advance.
Following the react native documentation, i just created my first react-native app (just npx react-native init AwesomeProject no changes).I also added the enviromentalpath: C:\Users\thijs\AppData\Local\Android\Sdk\platform-tools named ANDROID_HOME under uservariables. But when i try to run my code i get an error
Stack: Error: Failed to run the application in Android (error code 104):
Error while executing mand 'adb devices': Command failed: adb devices
'adb' is not recognized as an internal or external mand,
operable program or batch file.
at Function.getWrappedError (c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:152489)
at Function.wrapError (c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:13533)
at c:\Users\thijs\.vscode\extensions\msjsdiag.vscode-react-native-1.4.1\dist\rn-extension.js:1:203519
at processTicksAndRejections (internal/process/task_queues.js:97:5)
When i open cmd and go to the exact location where adb.exe is installed adb device works but when in do it in any other location it won't work
I've tried reinstalling android studio... No results. I've looked at other stackoverflow questions but no one seemed to have the exact same error as mine(i tried they're sollutions but no results).
This is my first time posting here if you need any additional information please ask. Thanks in advance.
Share Improve this question edited Apr 13, 2021 at 12:43 Eeplo asked Apr 13, 2021 at 10:05 EeploEeplo 351 gold badge1 silver badge5 bronze badges3 Answers
Reset to default 3The environment variables gets populated on process start-up, so you just have to restart the terminal (e.g. mand prompt) after you modified the environment variables.
If you are using IDE such as Visual Studio Code, sometimes the terminal session get restored even you restarted. So you might have to kill the terminal too.
If this still not working, just restart your PC.
You need to add the adb path in Environment Variable path
In your Dir Where Adb is located copy the path
Now add this copied path to the end of PATH of environment variables[System > Advanced System Settings > Environment Variables...
In this Environment Variables window, in the User variables for (your-username) highlight Path and click Edit...] or by
set PATH=%PATH%;your adb folder path
ex - set PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools" be careful the path that you want to add if it contains double quote
Try to set your environment variable as per the location of platform-tools
You can find adb in "ADT Bundle/sdk/platform-tools" Set the path and restart the cmd and then try again.
本文标签: javascriptError while executing command 39adb devices39 visual studio codeStack Overflow
版权声明:本文标题:javascript - Error while executing command 'adb devices' visual studio code - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742412996a2470160.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论