Zim
Zim

Reputation: 396

How to run expo --dev-client offline?

I normally run my app using the below command while having my physical device connected via USB debugging.

npx expo run:android

But now, I need to test offline functionality while still using the Metro bundler. Most suggestions I've seen use expo start --offline but I don't use Expo Go because I have native libraries. I tried expo start --dev-client --offline and it successfully built the app but when I switch to airplane mode on my device, it loses connection with the Metro bundler. This is especially difficult because I need to start the app already in offline mode and I can't do that because it needs connection to the development server.

The only workaround I can see is actually build an apk, install and open that in offline mode, but then I can't debug because there's no metro. And building using EAS takes forever.

Any suggestions?

Upvotes: 10

Views: 1031

Answers (0)

Related Questions