I built a custom ROM based out of AOSP (7.0 for Nexus 6) and I would like to use this ROM with SDK emulator. The lunch combo for the build is 'aosp_x86_64-eng' which I believe
should work on SDK emulator. However, I don't see an option in AVD Manager to specify my custom system image. It only allows me to use the listed ROMs from Google.
I tried copying my custom ROM's system.img over the stock Nexus 6 AVD but the emulator doesn't launch after that.
Note that the emulator that gets generated during the build works fine. But the build happens on a server, and I want to use the generated ROM on my development machine with my SDK's AVD Manager.
Found out that it can be done using the following steps.
Create a compatible AVD using the stock AVD System Images. In my case, I used a system image that is for Nexus 6 running Nougat on x86_64 ABI.
Go to ~/.android/avd folder and then locate the folder for the AVD that you created above (ex. ~/.android/avd/test.avd). Copy your custom system.img file into that folder.
Run the emulator!
When I tried it for the first time this didn't work for me because I have chosen the wrong base image (Nougat x86 instead of x86_64). Catch is to make sure that the stock system image is fully compatible with your build.
Related
I am trying to run an android AOSP 12L system.img file-that was built for arm64- on an android emulator.
I had downloaded the android source code for the Sony Xperia 10 III device from the Sony developers guide. I followed the procedure that is mentioned on Sony's open device project website to do a custom build of the android AOSP 12L.
The build of the source code was successful after which the following .img files were generated:
system.img,
boot-5.4.img,
ramdisk.img,
vbmeta.img,
I want to run these images on an emulator before flashing it to the Sony Xperia 10 III device.
I downloaded the Android Studio by Google. The emulator version installed on it is Android Emulator 31.2.10. Unfortunately, it does not have the provision to run a custom built image rather it only provides the android images provided by google.
I had downloaded the android 12 system.img for arm64 from the options listed and tried swapping that system.img file with the system.img file that was built by myself. But the emulator does not start and shows "Android emulator has been terminated".
I downloaded the Anbox emulator and that starts with its own android image and does not have the provision to run out system.img file.
Is there a way in which I can use any android emulator to run the system generated .img file?
Awaiting your response.
You can create AVD images which can run on Android Emulator.
For the same, you can use
make -j32 sdk sdk_repo
command.
This will create an SDK for you which will be located
aosp-master/out/host/linux-x86/sdk/sdk_phone_x86/sdk-repo-linux-system-images-eng.[username].zip
You can use this zip for the creation of emulator and test your functionality. More on this can be found on this website.
Hope this helps !!
I built an Android source on my server successfully. The commands I used are
source build/envsetup.sh
lunch aosp_x86-eng
make -j32
I can also run the emulator successfully on the server without GUI because the server has no available video device. In order to visually see the emulator, I followed the steps mentioned in here and here to move several built images to my laptop (a MacBook Pro). Basically, I used Android Studio to create a x86 emulator and copied several image files (e.g., system.img, ramdisk.img, userdata.img) into the corresponding avd folder. However, when I try to launch the emulator, it only shows a blank screen without any progress even after 5 mins. I have tried to switch off gpu, switch to software rendering, and switch to cold boot but with no success.
I don't understand the reason because it seems others can succeed after following these steps. Can anyone tell me what mistakes I made?
After several days of search, it turns out the answer is pretty simple. Here is what I did to make it work:
Download Intel x86 Atom System Image (previously I only had Google APIs Intel x86 Atom System Image) in Android Studio.
Create an emulator without Google APIs.
Copy the system.img and ramdisk.img I built on server into <SDK folder>/system-images/android-XX/default/x86/ on my MacBook.
Lunch the emulator and it works pretty well.
I also found if using an emulator with Google APIs, it can only work in software - GLES 2.0 mode. But WebView doesn't work in such mode.
So it seems the reason of a blank screen is because I use an emulator with Google APIs... I don't know why but it works.
I am working on android emulator. I successfully upgraded the kernel of emulator. now I want to change the OS of emulator. I know we can select the appropriate APIs from the android SDK manager. But i want to install jelly beans manually or you can say i want to upgrade ICS to jelly beans in emulator.
Is there any way to do manually install source code of android 4.3 on emulator??
You can only change the API the emulator uses and then you'll probably have to restart it. I can't imagine it would simply change Operating Systems. I just create a different AVD for each API I use and run them when I need them (with an API 18 Emulator always running).
You will need to use the Android SDK to compile Android 4.3 from source. Choose the emulator as your build target. For example, to create an engineering build (full debugging capability, largest output size) for the ARM emulator:
$ lunch aosp_arm-eng
Visit the official Android page on Building the System for full details:
http://source.android.com/source/building-running.html
After the build completes (it will probably take a few hours, at least the first time) you can use the files from the out/ subdirectory of the source tree to run in the emulator. These include system.img, userdata.img, ramdisk.img, etc
When I run my Trigger.IO app in the Android emulator, Trigger.IO automatically creates an Android virtual device using the Android 2.2 target. I have learned that I can improve the speed of the Android emulator by choosing the Intel Atom x86 target (see http://software.intel.com/en-us/android). How do I configure Trigger.IO to use the Intel Atom x86 target? I have tried modifying the AVD created by Trigger.IO after it has been created, but Trigger.IO simply deletes and recreates the AVD using the Android 2.2 target the next time I run it.
As far as I know there are two ways to achieve this when working with Trigger.io:
1) As long as you don't have any devices connected and only the emulator of your choice running, you can just use forge run android to install and launch the app on this particular emulator.
In case you have multiple emulators running and/or android devices connected, you need to specify the emulator id. It can be found in the title bar of an android emulator application and is followed by the name of the AVD (see the screenshot below). Example: You got an emulator named android403 which is started and its title bar says 5554:android403. Just use forge run android --android.device emulator-5554 to run your app in this specific emulator.
2) You can package your app using forge package android and download the resulting .apk file to your emulator. Just install it the same way you'd do on a real device. Make sure to enable SD Card support on your emulator when using this method.
If you are going to mix up both methods there is one more thing: An app installed via method 2 cannot be automatically overwritten by an install process described in 1. You'd have to manually uninstall the app beforehand. However, as long as you stick to one of the two you should be fine without manually uninstalling anything.
Another thing that you should know in this context is that apps built with Trigger.io are incompatible with the Android 2.3.3 (API 10) emulator. They will work on real devices running this Android version though.
I've created a custom build of Android and got it running as an emulator image on the development machine. I need to be able to use that image on another computer running Windows (it was built on the Mac). I've found the image files that the emulator uses (ramdisk.img, userdata.img and system.img) but I'm not sure how to create a new target that I can access from the SDK and AVD manager. Anybody have experience with this?
Thanks
You should perform the following steps:
Create a new AVD in AVD Manager with the version equal to your custor ROM.
Go to %userprofile%/.android/avd/your_avd_name.avd and substitute system.img with your built ROM
Run created AVD.