运行Android模拟器的错误:Spawn ADB Inoent

发布于 2025-02-02 07:48:08 字数 176 浏览 0 评论 0原文

我使用Expo CLI创建了一个新的React Native应用程序。 iOS Xcode仿真器工作正常,但是对于Android模拟器的错误,

Error: spawn adb ENOENT

我尝试卸载并安装后启动CLI。试图删除模拟器并创建一个新的模拟器。他们都没有工作。

I created a new react native app by using the expo cli.
iOS Xcode Emulator is working fine but getting below error for android emulator

Error: spawn adb ENOENT

I tried to uninstall and install back expo-cli. Tried to delete the emulator and create a new one. None of them is working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

惯饮孤独 2025-02-09 07:48:09

我处在您的情况下,我刚刚安装了博览会,并试图在Mac上的模拟器中运行该应用程序。

显然,问题是Android_home和ADB并未设置在我的$路径中。

我通过参考选项3(我已经安装了Android Studio)的最高投票答案在这里。 如果您想知道我做了什么,默认情况下使用ohmyzsh,所以我做了以下操作:

nano .zshrc

在.zshrc文件中添加这两行。

export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

然后在您的终端中运行此操作:

source ~/.zshrc

重新启动您的终端,现在一切正常!

I was in your same situation wherein I’d just installed expo and tried to run the app in an emulator on my Mac.

Apparently the problem was that ANDROID_HOME and adb weren’t set in my $PATH.

I solved it by referring to Option 3 (I already had android studio installed) of the top voted answer here. 

In case you want to know what I did, I use ohmyzsh by default so I did the following:

nano .zshrc

Add these two lines in the .zshrc file.

export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Then run this in your terminal:

source ~/.zshrc

Restart your terminal and now everything works!

可是我不能没有你 2025-02-09 07:48:09

在运行世博会时,我正面临问题。我通过运行此命令解决了它。

 npx expo prebuild --clean

I was facing an issue while running the expo project. I solved it by running this command.

 npx expo prebuild --clean
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文