Problem building apk without publishing in order to test it

Hello guys, I am trying to build a new APK without publishing it, so I’m running expo build:android -t apk --no-publish. I’d like to build this APK for local testing only, I don’t want who ever downloaded it to receive this dev version.

But, the builded APK always seems to open the older version that is published and never open the version I just builded. I disabled OTA updates by setting updates.enabled = false on app.json.

Here’s my diagnostics:
Expo CLI 3.25.1 environment info:
System:
OS: Linux 4.4 Ubuntu 20.04.1 LTS (Focal Fossa)
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
Yarn: 1.22.5 - /mnt/c/Users/T-Gamer/AppData/Roaming/npm/yarn
npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm
npmPackages:
expo: ~37.0.3 => 37.0.8
react: ~16.9.0 => 16.9.0
react-dom: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4

fyi: I have the same problem, came here to see if anyone had a solution.

apk includes last published bundle, so if you run build with --no-publish flag it’s using code from previous publish.

There is no way to use local code without publishing, but you can do that on different release channeland it won’t affect production apps.
expo build:android --release-channel test123 will publish current code to release channel test123 and only apk build with this release channel will download them. Default release channel is default.