i was having the same problem in ubuntu what worked for me is that i closed terminal removed my device from usb restarted. first of all would suggest you add these lines inside your packages.json replace scripts with this
"scripts": {
"prepare-repository": "npm i -g react-native-cli yarn;yarn install; react-native link",
"emulator": "emulator -avd Nexus5V6L23_x86_64 -scale 1.0",
"install": "react-native run-android",
"start": "react-native start --reset-cache",
"android": "npm run install && npm run start",
"clean": "watchman watch-del-all && npm cache clean && cd android && ./gradlew clean && cd ..",
"test": "jest"
}
After that save it and then go to the folder where u created project. lets say mine home/workspace/demo. Inside that run script
npm run clean this will clear all cache
after that
npm run android
It will run app in device as well as start-reset cache.Let me know if it helps.
Edit!!!
Sometimes adding
adb reverse tcp:8081 before running npm run android does the tricj
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…