Other answers completely miss what the OP wants.
To anyone who comes across a similar issue -
Try manually starting your adb server before starting Expo.
$ adb start-serverSounds obvious, but make sure USB debugging is enabled. However, on the very first run, your phone will ask to allow access from your computer. Set this to always allow access from your computer.
Open the Expo app (update if possible). On running the command
$ expo start --localhost --android, you should see your app launch on your device.
PS: This method is good for users like me who are paranoid about their phone's battery use. Connecting via a USB is less demanding on the phone & battery, as compared to using the wifi.
Answer from roshnet on Stack OverflowVideos
Other answers completely miss what the OP wants.
To anyone who comes across a similar issue -
Try manually starting your adb server before starting Expo.
$ adb start-serverSounds obvious, but make sure USB debugging is enabled. However, on the very first run, your phone will ask to allow access from your computer. Set this to always allow access from your computer.
Open the Expo app (update if possible). On running the command
$ expo start --localhost --android, you should see your app launch on your device.
PS: This method is good for users like me who are paranoid about their phone's battery use. Connecting via a USB is less demanding on the phone & battery, as compared to using the wifi.
Are you working with expo managed workflow or bare workflow ?
In the both cases you need to check if you are connected on the same network with your device and your computer.
Sometimes just quit everything and relaunch the project after turn off/on your Wi-Fi works.
To launch your app you just need expo start or npm start, nothing else, if you're working with managed workflow.
Hi,
A test app:
$ npx create-expo-app -t tabs hello
$ cd hello
$ npx expo run:android
This sequence installs an app named hello on my Android phone connected via USB. This is pretty much the same build sequence as with any other tool chain, like Flutter.
Like with Flutter, or Kotlin, I expected the app to remain viable on my phone after the USB connection is severed. However, on its own the app won't pass beyond the splash screen. After some moving around I got an error message:
Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
What do I have to do to make the (debug?) version of the app running on my phone autonomously?
I ran ‘npx expo prebuild’ and created ios & android projects and tried to run the project on my android phone using android studio but it says error saying bundle server error or something. Is there any other way to run on the physical device? Can somebody help me. Thanks
I don't own a laptop/PC so I code in mobile using termux app. I've previously created few test apps using expo react native and "expo go" app from playstore and used expo services to build apk and aab files. It was a good experience. Now I want to build Android apps using expo. When I try to run "npx expo run:android" in the terminal, I get error something like this:
Error: spawn adb ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)It maybe bcoz I don't have adb installed in termux, I can't have an adb. Isn't there a way to use expo run: android in "expo go" app only ? Just like using npm start starts in exp://127.0.0.1:19000/ . Or is there any expo cloud service to help us with that ?
Yes you can:-(With zero android studio config)
- Install expo-cli globally.
- Install android Studio.
- Create a project by running expo-cli init
- No need of any configuration on android Studio.
- Open existing Project from android studio
- then Open the created expo Project it will be available as an android project with a android logo on it
then open the AVD Manager
Download and install whichever device you want but see to that its above android N and do it for x86
- after Installing the desired emulator
- run the emulator before running the project
- then run expo start to start the Project
Go to the metro builder and say run android
if it doesn't run on the first go or if you get error close the project from emulator from recents and do a run on android again from metro builder don't close project just the running project from recent on emulator
- then it should work
Maybe too late, but I found out that is simplier that what you think.
- Install your Android SDK (studio)
- Create new emulator: Go to Tools > AVD Manager > Create new virtual device (I chosen Nexus, Android 7)
- When you get new emulator installed try to find out list of it ( command:
emulator -list-avds) - !! If you do not have emulator in the path follow this commands in PowerShell:
PATH = %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\platform-tools
PATH= %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\emulator
PATH= %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\tools\bin
- Run your emulator:
emulator -avd [NAMEOFYOUREMULATOR]from the commandemulator -list-avds - When emulator runing go to your Expo root folder (wher package.json is) and run
npm start - Click on run in Run on Android device/emulator
Enjoy coding
Edit for Linux users
my linux usecase is as follow:
- Install Android studio and open it
- Install any emulator using AVD manager and try it's working
- Close studio and go to your android folder
~/Android/Sdk/(two options 'emulator/' or 'tools/'), basically you need to find emulator - list item
./emulator -list-avds - choose your emulator and run it
./emulator -avd <any emulator>if emulator not work use sudo if you do not get any options in Sdk folder but you installed emualtor than you did it propably as a superuser - then the easiest is to completely remove all android studio and install it again