Is it possible to update the application version in a running instance?

Hi! I am trying to find a solution to update the application version on a running instance without restarting it or creating a new instance with the updated version, but so far without success, could you tell me how to update the application version without creating a new instance? The anbox documentation describes how to update the application version, and it is proposed to create a new instance by specifying the new version of the application, but it does not say how to do this without creating a new instance, but to update the application in an already running instance with the application of the previous version.

Hey Aleksey,

I am trying to find a solution to update the application version on a running instance without restarting it or creating a new instance with the updated version, but so far without success, could you tell me how to update the application version without creating a new instance?

Can you help us to better understand what you’re doing? An application in AMS is a construct to help building versioned images which can then be used to spawn instances. What do you want to achieve by updating the application version of an already running instance? Typically you would want to create a new instance for the new application version, not the other way around.

Or do you mean on how to update the APK of an Android application you put into an application managed by AMS? If you want to do that, you can run something like adb install -r my.apk inside the instance. This though assumes you have the watchdog disabled (see here for more details).

Alternatively you also have the option to create an instance without creating an application first and then manually maintain it over time.

Thanks for the reply, I’ll explain what I meant. Here I mean more that, for example, I downloaded an application of some version and then created an instance of this application with the current version, then I downloaded using your API PATCH: 1.0/applications/{id} the same application of another version (and it seems to me that you have a bug here, as I can through this endpoint can load as many identical versions of the application as you like, but in the sandbox console they will be different versions with increments starting from scratch) and now I would like not to create a new instance with a new version, but to somehow update the current instance to the new version without deleting it. Yes, you said correctly that I can do this with adb, but I wanted to know if you have any other tools to do this?

Oh that is interesting. Can you file a bug over at Bugs : Anbox Cloud with the steps you’re taking to run into this?

If you do not want to create a new application version but keep the current instance, then the only way to update the installed APK is to install a newer version of it via ADB. Alternatively you can do also something like this from within the Anbox instance:

$ amc shell test0
test0$ cp my.apk /var/lib/anbox/data
test0$ anbox-shell pm install /data/my.apk

That will achieve the same result as via adb install. You can also use adb from within the Android instance, e.g.

test0$ apt update ; apt install -y adb
test0$ adb install -r ./my.apk

I’m sorry that I’m responding late. Thanks for the answers. And I also wanted to clarify about adb. There is an endpoint in your API that I can use to connect to the /1.0/session/{id}/sockets/adb container. Here is the link to the documentation. https://documentation.ubuntu.com/anbox-cloud/reference/api-reference/gateway-api/#/session/handle-adb-connect-session I was wondering if I could use this to connect to a container via a web socket and send adb install commands, for example, to install packages.? I also noticed that if you click Connect db from the anbox console and copy the address of anbox-connect "https://anbox.edm-tech.mts.ru/1.0/sessions/cvdiefllulef17m1u2k0/connect ?token=AgEUYW5ib3gtc3RyZWFtLWdhdGV3YXkCGmFkYjpjdmRpZWZsbHVsZWYxN20xdTJrMDo2AAIUMjAyNS0wMy0yMVQxMzo0MDo0NFoAAhdpZD1jdmVtb241bHVsZWYxN20xdTNxZwACCHR5cGU9YWRiAAAGILKX6K9eRAmR5eF3CO2oIhszY_IwBWkgcEiTuVG6f6tY " then you can get an address in the response for connecting to the container via a web socket. “wss://anbox.edm-tech.mts.ru/1.0/sessions/cvdiefllulef17m1u2k0/sockets/adb?token=AgEUYW5ib3gtc3RyZWFtLWdhdGV3YXkCGmFkYjpjdmRpZWZsbHVsZWYxN20xdTJrMDo2AAIUMjAyNS0wMy0yMVQxMjo0MzowNloAAhQyMDI1LTAzLTIxVDEyOjQ4OjA2WgACCHR5cGU9YWRiAAIXaWQ9Y3ZlbHNkbGx1bGVmMTdtMXUzcGcAAAYgKGPTe6oqekpqy-4H4-ZUluFqFOFqpT-M0gwRxdXziyw&id=cvelsdllulef17m1u3pg” and in this case, I can use it to send commands like adb install to install packages as well.?