You are here:
< Back

How to repair device after WebView replace failed

If the WebView replace failed on your device then you have to follow these steps:

Repair WebView locally through ADB

  1. Open a command prompt on your PC, and connect to your device via ADB. (https://developer.android.com/studio/command-line/adb/)
  2. Once you are connected, use the ‘adb shell’ command to access the terminal on your device.
  3. First, type ‘su’ to have superuser privileges.
  4. Remount the device’s system partition with the ‘mount -o rw,remount /system’ command (If your device’s Android version is 9.0 or higher then use this command: ‘mount -o rw,remount /’)
  5. Then move to the WebView application folder (‘cd /system/app’).
  6. Here check if there is a folder called WebView (‘ls -l’).
  7. If you find the WebView folder then remove it (‘rm -rf webview’).
    Now the WebView is permanently deleted from the device.
  8. Download the latest WebView application from here: https://www.bromite.org/
  9. Exit from the shell with the ‘exit’ command (sometimes you have to use it twice to exit fully), and install the downloaded WebView application with adb (‘adb install <path of your downloaded apk>’).
  10. Open the shell again (2. And 3. step), and find the installed application’s folder (‘cd /data/app/’), and if the install was successful then the com.android.webview folder will be there.
  11. Remount the device’s system partition with the ‘mount -o rw,remount /system’ command (If your device’s Android version is 9.0 or higher then use this command: ‘mount -o rw,remount /’)
  12. Go to the /system/app folder and move the installed webview application from the /data/app folder to the /system/app folder (‘mv /data/app/<your webview> /system/app’)
  13. Rename the folder to webview (‘mv <old directory name (which you have just moved here in the previous step)> webview’) and set its owner and group to root, and its permission to 755
    (‘chown -R root:root webview/’,
    chmod -R 755 webview/’)
  14. Move into the WebView folder with the ‘cd webview’ command, and rename the .apk file to apk (‘mv <old apk name> webview.apk’ ) and set its permissions to 644. (‘chmod 644 webview.apk’)
  15. Reboot your device.
  16. After the reboot clear the application data. (Settings -> Apps -> <Your app name> -> Clear data)

Repair WebView remotely with Terminal Emulator

  1. Download Terminal Emulator software to your computer
  2. Connect to the device remotely with TeamViewer for example
  3. Copy the Terminal Emulator installer apk to the storage of the device
  4. Install Terminal Emulator and open it
    1. First, type ‘su’ to have superuser privileges
    2. Remount the device’s system partition with the ‘mount -o rw,remount /system’ command (If your device’s Android version is 9.0 or higher then use this command: ‘mount -o rw,remount /’)
    3. Then move to the WebView application folder (‘cd /system/app’)
    4. Here check if there is a folder called WebView (‘ls -l’)
    5. If you found the WebView folder then remove it (‘rm -rf webview’)
      Now the WebView is deleted from the device
  5. Download the latest WebView application from here: https://www.bromite.org/
    (arm64/arm/x86_SystemWebView.apk based on the device architecture)
  6. Copy the WebView installer apk to the storage of the device
  7. In Terminal Emulator
    1. Install the downloaded WebView application with pm install (‘pm install <path of your downloaded apk>’)
    2. Find the installed application’s folder (‘cd /data/app/’), and if the install was successful then the com.android.webview folder will be there.
    3. Remount the device’s system partition with the ‘mount -o rw,remount /system’ command (If your device’s Android version is 9.0 or higher then use this command: ‘mount -o rw,remount /’)
    4. Go to the /system/app folder and move the installed webview application from the /data/app folder to the /system/app folder (‘mv /data/app/<your webview> /system/app’)
    5. Rename the folder to WebView (‘mv <old directory name> webview’) and set its owner and group to root, and its permission to 755
      (‘chown -R root:root webview/’,
      chmod -R 755 webview/’)
    6. Move into the WebView folder with the ‘cd webview’ command, and rename the .apk file to webview.apk (‘mv <old apk name> webview.apk’ ) and set its permissions to 644. (‘chmod 644 webview.apk’)
  8. Reboot your device
  9. After the reboot clear the application data. (Settings -> Apps -> <Your app name> -> Clear data)

If all the steps are done correctly then if you start the application it will start normally.