Get APK updates that are not yet in stores

I’ve read in the documentation that once you build your app to the store then you don’t need to rebuild every time you edit Javascript files. However, it seems that this will only work when your App is in Google Store or App Store.

My App is still in the development phase and still needs some time before it gets to the stores. My client wants to always see the updates that I have in an APK. I already provided an APK for that client that was built from expo build:android, but now I need to make javascript updates to the App. Do I need to rebuild another APK for that client? Or can the client receive my updates some other way? expo publish didn’t update the APK that the client has.

Hi

I’ve moved your post to the “How To” category :slight_smile:

It’s not necessary to rebuild the APK and for your client to reinstall it. When you make changes to the JavaScript you can run expo publish to bundle that and upload it to Expo’s servers. By default your app will check for updates when it restarts (but your client will need to make sure the app is closed and not just in the background for this to happen.) Then the next time the app is started it will load the new JS bundle. So closing the app, opening it again and doing that again should get the updates.

There is also an Updates module that you can use to check for updates and restart in your code.

The following is how I do it in one of my apps. I gave the app to someone who installed it manually on his phone and I can publish updates. The only times I’d need him to install a new APK is if I upgrade to a later SDK or make changes to app.json:

See also:

https://docs.expo.io/versions/latest/workflow/configuration/#updates

Thank you for the reply.

It seems that I need to run expo publish. Then start the Development Server again using expo start, and then close the App and reopen it. I guess I could look at your guide at some point to have updates without the need of closing the App.

Is there something else besides the development server that Expo App developers use when the App still didn’t go to the stores (You mentioned expo servers?) I’m kinda new to expo and mobile development in general.

Given that you have built a standalone APK that your client has installed on the phone: when you publish, the development server does not need to be restarted. It is not involved anymore. Just bear in mind that the client might need to restart the app twice to get the update. After the first restart it should check for and download the new code/assets. After the second restart it should load the new code/assets.

When you run expo publish the JavaScript and assets are bundled together and uploaded to some servers belonging to the Expo team (“Expo’s servers” that I referred to in my last message). When the APK wants to check for updates or download an updated bundle it contacts these same servers on the Internet. So after you have published the app your development server is not relevant to your client’s APK.

The development server is only used for you while you are developing.

If your client was running the Expo app instead of your standalone app then you could potentially run your dev server in “tunnel” mode and have your client open the app from there, but that is more error prone and might be confusing to the client. Also there are a few differences between running in the Expo app and standalone (e.g. the Updates module only works in a standalone app), and since the final app that you upload to the Play Store will be a standalone app I think it’s better for the client to test with your standalone app rather than one running within the Expo app on their phone. (I hope I’ve explained this well.)

1 Like

Thanks that’s really helpful. I was assuming that I was getting the update ‘only’ because of the development server restart, but it seems that I was actually restarting the App two times whenever I wanted to test that assumption.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.