Hi,
can the zip releases from https://grapheneos.org/releases be used to run in android emulator? Or is a custom build mandatory? The structure/files of the release zips look quite different than those in android sdk "system-images/" folder.
Thank you for any help. Best regards
Emulator
I think the releases cannot be used in the emu, as they're built for arm, whereas the emu on PC requires x64/x86 compiled ones.
Is there a source to download a pre-built emu image of GOS for PC?
[deleted]
I would like to know as well..
- Edited
Dear GOS dev team,
Reading the docs about building GOS, the actual procedure seems to be as follows:
- download the full source code of several hundreds gigabytes from internet.
- compile the sources, which takes several hours on an average PC.
- build the emu image (time required unknown).
Repeat steps 1. - 3. with every new release of GOS (every few days or weeks in general). And repeat steps 2. - 3. for any config changes (debug, release, etc.).
Fast internet connection, lots of disk space, and fast PC with lots of RAM is required. And lots of time on every release.
I think, there would be lots of benefits, if an actual emu image would be available for public download:
- anyone can run GOS in the emu, for any tests of the OS itself, or to check any apps/confis or other stuff they want to try (in a safe/revertible way off the physical phone).
- people that want to contribute to GOS have an easier time setting up a dev env.
- 3rd party devs can test/check their apps against GOS easily (which won't be the case, if they've to build the emu theirselves, nor owning a physical phone running GOS).
- no need of USB, adb, etc. in any such cases.
- no need for a powerful PC
- no need for Linux
I understand, that the GOS team would have one more thing to maintain. I think, as the devs are building GOS, and the emu, in any case, for each new release, the added efforts to make a public download would compensate by adding big benefits as stated above.
Please let me know your valued thoughts. Thank you
TRInvictus I think, there would be lots of benefits, if an actual emu image would be available for public download.
I built the emulator once a while ago. It wasn't a life-changing experience for me. The emulator emulates some things amazingly well and other things much less well. I think it is most useful for application developers who want to run an in-development application in a debugger. But since GrapheneOS runs regular Android apps (e.g., from F-Droid) it's not clear what benefit there would be to most app developers to use a GrapheneOS-specific emulator build.
An emulator build without a full build environment would not enable somebody to contribute to the OS (as opposed to building apps).
Overall it's not clear how much upside there would be. Do other AOSP variants ship emulator builds? I just looked quickly and I didn't see one for DivestOS.
TRInvictus Fast internet connection, lots of disk space, and fast PC with lots of RAM is required.
It might be feasible to briefly rent a VM from a cloud provider to do a build, then destroy the VM. I have not done this. I used a somewhat underpowered machine, reduced the build parallelism, and let it run overnight - that would be very impractical for a GrapheneOS developer, but less problematic for doing one build per month (or, in my case, more like one build per year).
de0u it's not clear what benefit there would be to most app developers to use a GrapheneOS-specific emulator build.
GOS is more restrictive than (almost every) other OS's, so there'll be differences to running an app in Google's emu of Android Studio.
de0u Overall it's not clear how much upside there would be. Do other AOSP variants ship emulator builds?
Haven't found any others that Google's, and BlueStacks and such stuff. Those aren't any options I'd use as dev env.
However, seems there's no interest at all, no reactions, no comments, 250k GOS users, 0 devs of 'em. Sigh
One more thought pro privacy about a GOS emu build: one would not have to connect the real physical phone to eg. Android Studio, which reveals pretty much everything to Google (I assume). I would not do that for sure.
Latest release would be more than enough I think, no need to keep copies of each release for this on the webpage/servers, imo.
If someone had the chance to talk to the GOS dev guys about this, would be really very much appreciated. Maybe, somewhen, somehow.
madlips well can you give some explanation on how you built the emulator with GOS
I didn't use GrapheneOS to build the emulator (I don't think that's possible). I used Ubuntu (on an x86-64 box) to build GrapheneOS, including the emulator target.
I don't know whether or not this was the best thing, but my build was:
$ choosecombo release sdk_phone_x86_64 userdebug
$ rm -r out
$ m -j 8
The -j 8
part allowed the build to finish on my machine despite limited RAM. The build ran for around 10 hours.
I think to run it what worked best (although not very well) was:
$ adb start-server
$ emulator -no-audio -no-boot-anim
At least in my experience at the time (which was more than two years ago), the emulator got stuck forever doing the boot animation unless I used the -no-boot-anim
flag.
Again, the result was not life-changing for me. Running the emulator build in the emulator is not a good way to find out what running GrapheneOS on a phone is like. I was unable to get some downloaded apps to run on the emulator at all -- I think apps including native ARM code didn't work because the emulator was an x86-64 build of GrapheneOS. So the emulator was not useful for compatibility-testing apps against GrapheneOS.
Overall, it seemed to me that emulator builds of AOSP were designed to be somewhat useful for people developing an app, and useful to a very limited extent for people developing OS changes. But it seemed clear that real testing of either an app or an OS build would require connecting the debugger to an installation on a real device.
de0u It's not clear what benefit there would be to most app developers to use a GrapheneOS-specific emulator build.
TRInvictus GOS is more restrictive than (almost every) other OS's, so there'll be differences to running an app in Google's emu of Android Studio.
If that were true for regular apps, it wouldn't be possible to run regular apps from F-Droid or Google's Play Store on GrapheneOS. Nobody is doing GrapheneOS-specific builds or GrapheneOS-specific debugging of those apps, but they run. There are corner cases, like the recent restrictions on dynamic code loading, but the vast majority of apps are not affected by those.
GrapheneOS restricts the Play infrastructure more than Google's OS does, likewise Android Auto. But it's not clear how useful an emulator build would be for debugging those issues, and presumably that is done by a small number of GrapheneOS developers, for whom a static build from the web site probably wouldn't be useful.
madlips Is there any possibility i can install grapheneOS with emulator like AVD (android virtual devices) on Android Studio?
I expect so. The directions for building an emulator image for Android Studio (source) look like what I did when I built an emulator image.
But the key thing to understand is that the emulator does not faithfully emulate all hardware on a real device. If you build an x86-64 version of GrapheneOS (which the build system will let you do), it will not behave the same way as an ARM version of GrapheneOS. And the emulator hardware stubs out various security functions, so running an app on the emulator, whether the system image is GrapheneOS or not, will not run the app in a secure environment.
Meanwhile, for the purposes of building a regular Android app to run on GrapheneOS and other AOSP variants (e.g., LineageOS), using the AVDs that come with Android Studio is fine, because apps that run on pure AOSP also run just fine on GrapheneOS (and LineageOS, etc.).
Can I turn the question around? What do you hope will be different if you have a GrapheneOS AVD for Android Studio, compared to using the AVDs that already ship with Android Studio?