A WebAPK is an APK which is installed by “Add to Home screen” in the Chrome app menu provided that the website meets the requirements.
Sample site which meets WebAPK requirements
https://pwa-directory.appspot.com/
Code layout
Installing WebAPK from Chrome Developer Build
To enable a developer build of Chrome to install WebAPKs run the following commands:
adb root
adb shell am broadcast -a com.google.gservices.intent.action.GSERVICES_OVERRIDE -e finsky.webapk.do_webapk_install_package_check false
adb shell am broadcast -a com.google.gservices.intent.action.GSERVICES_OVERRIDE -e finsky.webapk.do_webapk_install_signing_check false
Building WebAPK shell locally
It is possible to build a test WebAPK and bypass the generation on the WebAPK server.
On Android, build
//chrome/android/webapk/shell_apk:new_splash_webapk (new_splash=‘Android’)
On ChromeOS, build
//chrome/android/webapk/shell_apk:webapk
Both can be customized via shell_apk/manifest/bound_manifest_config.json
To make a locally built WebAPK launch Chrome in ‘WebAPK mode’:
Set the --skip-webapk-verification Chrome command line flag
Ensure that the ‘scope_url_*’ parameters in bound_manifest_config.json match a directory which contains the ‘start_url’ parameter. In 99% of test cases the other parameters can use arbitrary URL origins.
Example:
"intent_filters": { "scope_url_scheme": "https", "scope_url_host": "foo.com", "scope_url_path_type": "android:pathPrefix", "scope_url_path": "/bar/" }, "start_url": "https://foo.com/bar/baz/start.html",