I am trying to launch an instant app to the mobile using the following steps:
- Generate signed apk of Instant App in Android Studio, which would produce a zip file containing Base apk file and feature apk files.
- Unzip the generated file.
- Use command
adb install-multiple -r -t *.apk
to install the app. I was told to useadb install-multiple -r -t --instantapp *.apk
but--instantapp
tag would give me a following error:Exception occurred while dumping: java.lang.IllegalArgumentException: Unknown option --instantapp
So after doing this, I would expect instant app to be installed in my mobile device. Interestingly, Instant App is launchable, however it creates a normal app icon as if it is not an instant app. If I go Setting -> google -> Instant Apps, list of installed instant app is empty.
Also, the behaviour of Instant App installed this way is different from the Instant App installed directly using Run
in Android Studio.
The devices I used are Google Pixel(8.0.0) and Nexus 5X(7.1.1).
Thanks for your help.
I have these in my manifest and it works fine.
A much easier way to do this is using the instant apps CLI present in the Instant Apps SDK versions 1.2 and above. Download the SDK using the SDK manager (either in Android Studio or from the command line version) and add
extras/google/instantapps/ia
(inside your SDK folder) to your PATH.Then you can do
ia run <something.zip>
to launch instant apps on any supported device from the command line. Note that if you're using an emulator, make sure the version of Google Play services on the device is up to date (you can update it from the emulator's control panel).The command you were looking for with the install-multiple command is
install-multiple -r -t --ephemeral *.apk