简体   繁体   中英

react-native > Running android simulator results in “Could not launch” emulator error

I'm trying to run a react-native android simulator using the react-native-run-android library, but I receive the following error:

Could not launch '/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386'

I have the emulator successfully installed, and I can run android from Android Studio > AVD Manager .

The library is looking for an /usr/local/emulator folder (but it was installed in another directory). First I checked whether the directory existed (it didn't), found where the installation directory actually was, then created a symbolic link to the actual folder location. Finally, check the requested directory exists, then everything worked.

ie

$ ls -la /usr/local/emulator
ls: /usr/local/emulator: No such file or directory
$ which emulator
/usr/local/bin/emulator
$ ls -la /usr/local/bin/emulator
lrwxr-xr-x  1 user admin  64 13 Aug 09:56 /usr/local/bin/emulator -> /usr/local/Caskroom/android-sdk/3859397,26.0.1/emulator/emulator
$ sudo ln -s /usr/local/Caskroom/android-sdk/3859397,26.0.1/emulator /usr/local/emulator
Password:
$ ls "/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386"
/usr/local/bin/../emulator/qemu/darwin-x86_64/qemu-system-i386

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM