react- native:"adb"未被识别为内部或外部命令,可操作程序或批处理文件 [英] react- native: 'adb' is not recognized as an internal or external command, operable program or batch file

查看:113
本文介绍了react- native:"adb"未被识别为内部或外部命令,可操作程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是本机android应用程序开发的新手.请帮我解决这个问题.

Am new to react-native android app development. Please help me solve this issue.

由于我无法运行我的第一个应用程序,因此出现错误,因为 adb'无法识别为内部或外部命令,可操作程序或批处理文件.

Am not able to run my first application, am getting error as adb' is not recognized as an internal or external command, operable program or batch file.

我在android sdk-> platform-tools->中检查了一下,我在那里可以看到adb.exe.

I checked inside android sdk->platform-tools->i can see adb.exe there.

构建成功,但是在运行时出错.以下是我的 cmd提示

Build is successfull but getting error during run time. Below is my cmd prompt

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
E:\ReactWorkSpace\MyFirstApp>react-native run-android
Scanning 560 folders for symlinks in E:\ReactWorkSpace\MyFirstApp\node_modules (72ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportRecyclerviewV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:app:prepareComFacebookFrescoDrawee101Library
:app:prepareComFacebookFrescoFbcore101Library
:app:prepareComFacebookFrescoFresco101Library
:app:prepareComFacebookFrescoImagepipeline101Library
:app:prepareComFacebookFrescoImagepipelineBase101Library
:app:prepareComFacebookFrescoImagepipelineOkhttp3101Library
:app:prepareComFacebookReactReactNative0434Library
:app:prepareComFacebookSoloaderSoloader010Library
:app:prepareOrgWebkitAndroidJscR174650Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:transformClassesWithDexForDebug
Running dex in-process requires build tools 23.0.2.
For faster builds update this project to use the latest build tools.
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateSigningDebug
:app:packageDebug
:app:assembleDebug
:app:installDebug
Installing APK 'app-debug.apk' on 'A16 - 4.2.2' for app:debug
Installed on 1 device.

BUILD SUCCESSFUL

Total time: 7 mins 4.412 secs
'adb' is not recognized as an internal or external command,
operable program or batch file.
Starting the app (D:\Android\sdk/platform-tools/adb shell am start -n com.myfirstapp/.MainActivity...
Starting: Intent { cmp=com.myfirstapp/.MainActivity }

E:\ReactWorkSpace\MyFirstApp>

我没有使用模拟器,正在使用我自己的移动设备.应用程序已在我的设备中启动,但我看到的只是一个空白的空白屏幕.我按照官方网站上的说明正确地遵循了所有说明.

Am not using emulator, am using my own mobile device. App is launched in my device but all i see is a white blank screen. I followed all the instructions properly as mentioned in the official website.

谢谢.

推荐答案

我找到了解决方案.

您所要做的就是在系统变量中添加adb路径.

All you have to do is add the adb path in system variable.

复制adb位置,然后转到Controlpanel->系统->高级系统设置->环境变量->在系统变量下,您将找到 PATH 变量,先选择该变量,然后单击编辑",然后单击编辑".单击新建"并粘贴您的adb路径,现在单击确定".多数民众赞成在解决问题.

Copy the adb location, and goto Controlpanel->System->Advnaced System Settings->Environment Variables->Under System Variables you will find PATH variable, selct that first and click on Edit, then click on New and paste your adb path, now click Ok. Thats it problem solved.

现在重新启动命令提示符,然后运行 react-native run-android .它有效:)

Now restart your command prompt, and run react-native run-android. It works:)

希望这对某人有帮助.感谢您检查我的问题.

Hope this helps someone. Thanks for checking out my question.

这篇关于react- native:"adb"未被识别为内部或外部命令,可操作程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆