How to upgrade Android's Webview in Emulator (Android 5) How to upgrade Android's Webview in Emulator (Android 5) android android

How to upgrade Android's Webview in Emulator (Android 5)


5 year old question, and yet I found it yesterday and got to solve it after some tinkering.

First, as to why installing the webview from the play store doesn't work, that is answered in this question. In a nutshell, the emulator is using com.android.webview whilst google play installs com.google.android.webview. And there is no way (that I know of) to configure the emulator to use Google's webview. So using the play store is a dead end.

What I could achieve though is uninstall the default webview and install a newer version. I wasn't able to just upgrade it because the apk I got for the new webview had a different signature from the one installed. But uninstalling isn't straightforward either, because the webview is a system app and you won't be able to uninstall it running adb uninstall.

Here's what I did:

# Boot the emulator in write mode and make /system writableemulator @DeviceName -writable-systemadb remount# Uninstall the webview app manually and reboot the deviceadb shellrm -rf /data/data/com.android.webviewrm -rf /system/app/webviewreboot# Install the new versionadb install webview.apk

One drawback of this approach is that you'll need to boot your device in write mode for subsequent runs (no need to run adb remount again though). But it works!

In case you're wondering, I got the apk for the new version from Google's source (no need to compile manually).