Expo project on Linux from visual studio code on windows

I started a npm project on my Linux Debian, and got the code and the following output:

root@octopus:/home/deploy/hello-mobile# expo start

This command is being executed with the global Expo CLI. Learn more: https://blog.expo.dev/the-new-expo-cli-f4250d8e3421
To use the local CLI instead (recommended in SDK 46 and higher), run:
› npx expo start

Starting project at /home/deploy/hello-mobile
Starting Metro Bundler
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀ ▀ ▄ █▀█ ▄▄▄▄▄ █
█ █   █ █   █▀ ▄▀ █ █   █ █
█ █▄▄▄█ █▄█▀ ▄█▀▄▀█ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄█ █ █ ▀ █▄▄▄▄▄▄▄█
█  ▄▄▀█▄█ █ ▄ ▀▀▄▄ ██▄ ▄▀▄█
█ ▀▄ ▄ ▄█▀  ▄▄ ▄█  ██▀█▀███
█▄▀ ▀█ ▄▀█▄▄▀ ▄█▀▄█ █ █ █▀█
█▀▄██ ▄▄▄▀█▀ █▄▀▀██▀▄█▀█ ▀█
█████▄▄▄▄▀▄ ██▄ ▀ ▄▄▄ ▀▄█▀█
█ ▄▄▄▄▄ ██▄█▀▄███ █▄█ █▄▄▄█
█ █   █ █▀▀ ▀ █▀▀ ▄   █▀▀ █
█ █▄▄▄█ █ █▀▄█▀▄▄▄█▄█▄▄ ▄██
█▄▄▄▄▄▄▄█▄▄▄██▄█▄█▄████▄▄▄█

› Metro waiting on exp://10.3.19.16:19000
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)

› Press a │ open Android
› Press w │ open web

› Press r │ reload app
› Press m │ toggle menu

› Press ? │ show all commands

I have Visual studio code installed on my windows (11).

All documentation is showing how to init and start the project from visual studio code using windows
CLI.

Is there a way to tell visual studio code to use the project on the Linux?

Thanks,
Tamar

Hi @tamarnir

By the way, you should use npx expo start these days.

Could you please elaborate a bit on your development environment?

Do you have a physical Linux machine and a separate, physical Windows machine? Or do you mean you are running Debian Linux in WSL2?

It’s not clear to me what you are trying to do. VS Code needs access to the files in order to edit them. Of course the usual way would be to have the files on the same machine that you are running VS Code on. One way to do this would be to install and run VS Code on your Debian machine. Another would be to clone your project onto your Windows machine.

Instead, you could potentially share your project over the network and then map the share from Windows and edit the files using VS Code there, while running npx expo start on Linux. I have not tried this myself, so I’m not sure if you would run into any locking issues or anything like that.

Maybe if you explain a bit more about what you’re trying to do we can make some suggestions.

Hi @wodin

Thank you very much for your reply.
Some background explanation:
Our product is currently running on windows only.
Backend is developed using java spring boot on Eclipse IDE, uses Gitlab to share, keep and manage the code, and uses Jenkins for CI/CD.
Frontend also uses Gitlab and Jenkins.

We recently had a new requirement to build and run our product on Android. For that our frontend developers use now Visual Studio code as IDE for react native ,and expo to produce the apk.

As the frontend guy tells me, from the expo installed on his personal laptop, he is using this command in order to build the APK:
eas build --profile production --platform android

For our current product management, and since there are many developers here, Gitlab and Jenkins are installed on a remote Linux, so whatever tool the developers use locally on their PC, the code get finally built on the shared Gitlab repository, and delivered via Jenkins.
We need to understand how to configure expo to work the same way - or perhaps we misunderstand the whole concept here.

Thanks,
Tamar

Ah, OK, that’s clearer, thanks :slight_smile:

This is not something I have personally explored, but there is some documentation on integrating with CI and testing. Not specifically Jenkins, though.

You don’t need to worry about VS Code at all. That’s for the frontend guys to worry about on their Windows machines. GitLab will need to call eas build ... to build the app.

See Triggering builds from CI. Further down the page there’s an example GitLab .gitlab-ci.yml config file to trigger new builds of the app. I suppose you could trigger a new “development” build when pushing to a development branch, a “preview” build when pushing to a staging branch and a “production” build when pushing to a production branch, or something like that. For the production one you could also use the --auto-submit option to automatically upload the app to Google Play.

The eas build command uploads the code to Expo’s build servers and triggers the build process. The resulting APK (for development/preview builds) or AAB (for production builds) is not downloaded, but you can set up a Webhook to call when the build completes. The payload will contain a buildUrl that you should be able to download.

It might also be worth having a look at this GitHub action repository to see if there’s anything you might want to adapt to GitLab:

There’s also another repository which seems to have some overlap with the above one: expo/expo-preview-action

For testing, there is info on “jest” in the docs. e.g.: Testing with Jest
There is also some experimental support for E2E testing with Detox: Running E2E tests

In addition to building APKs/AABs, Expo supports over the air updates (OTA updates). This is done with the eas update command. So you might want to look into that after you’ve got the builds automated.

It’s probably also a good idea to read through this document:

EDIT: Things you can ignore:

  • Anything to do with the “Classic” build system, also known as “expo build:android”
  • Anything to do with expo start or npx expo start. That only needs to run on the frontend dev machines.
  • Of course, anything to do with iOS, Apple developer accounts, the Apple App Store, etc.