1. 程式人生 > >ReactNative執行Could not install the app on the device, read the error above for details錯誤

ReactNative執行Could not install the app on the device, read the error above for details錯誤

Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

可以先檢查adb是否連線:

adb devices

列表出現類似這樣的表示連線成功:

List of devices attached
emulator-5554   device

如果沒解決再檢查 sdk
命令列定位到當前RN專案目錄:在執行前執行

ANDROID_HOME=/Users/apple/Library/Android/sdk

手動設定 android sdk 目錄.

設定完後再執行

react-native run-android