When developing an Expo app on a PC you need to be able to run the app on an Android emulator as you don’t have any iOS simulators to work with like you do on a Mac. I found the Expo instructions a little lacking in some detail, and as a Windows PC user primarily, I struggled to find all the information I needed in one place, to run my Expo app in an Android Emulator.
So, to run your Expo app in an Android emulator :
- Start Expo by typing expo start on the command line.
- Open Android Studio.
- Open your project in Android Studio.
- Open the ‘AVD manager’ from the Android Studio toolbar.
- Run an Android emulator.
- Click ‘run on Android device/emulator‘ in the Expo client.
From Android Studio here is the open AVD Manager button:
To run an Android Emulator, click the play symbol next to the one you want to use from the AVD Manager window:
There’s a few problems you can find with each step, so here’s a few things to bear in mind if any of the above steps don’t work.
If you see this message:
“Couldn’t start project on Android: No Android connected device found, and no emulators could be started automatically. Please connect a device or create an emulator (https://docs.expo.io/workflow/android-studio-emulator). Then follow the instructions here to enable USB debugging: https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select “Use custom Android SDK tools”, and point it at your Android SDK directory.”
…it means that steps 2 and 3 probably haven’t been done. It’s not a particularly obvious message and you’d be surprised ho easy it is to forget both steps.
If you see a message saying:
“Couldn’t adb reverse: device ‘adb’ not found”
… most of the time if I ignore this and click ‘Run in Android Emulator’ again after a few seconds it runs just fine.Here is a link to React Native and Expo books on Amazon – I may receive an affiliate commission if you buy anything after clicking on this link.