When I started a new project
react-native init MyPrroject
I got could not connect to development server on both platforms iOS and Android.
My solution is to
sudo lsof -i :8081
//find a PID of node
kill -9
Also make sure that you use your local IP address
ipconfig getifaddr en0