Verify how an Instant App in Android is launched - android

According to the documentations, an Instant App is downloaded via Google Play and launched on the fly. It is not installed but is rather cached in the Android system. As a developer and user, I would like to validate this behaviour.
I have tried running Clash Royale by hitting the "Try now" - that is when a splash screen is shown with a progress bar (assuming that's when the feature APK is downloaded?) and it launches soon. On exit, there is no application icon which is expected.
In the device storage I looked for trace of the APK but with no success. Do I need ROOT permissions to see this? Is there a way to inspect and verify?

There is still an APK installed.
For O+ devices, run adb shell pm path com.supercell.clashroyale after TRY NOW
And you'll see:
package:/data/app/com.supercell.clashroyale-CUaYOumzCbUDNAdv1MRtRg==/base.apk
package:/data/app/com.supercell.clashroyale-CUaYOumzCbUDNAdv1MRtRg==/split_split_2_tutorial_battles.apk
Do it again after INSTALL (for comparison), and you'll see:
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/base.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.arm64_v8a.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.en.apk
package:/data/app/com.supercell.clashroyale-0Dn0s6yq6WqGCRZ9ETT8bA==/split_config.xxxhdpi.apk
(For pre-O devices, the first part won't work, but I don't know any other cmd that will do the same)

You can navigate to Settings -> Apps, and see instant apps there. The App Icon will have Lightning bolt sub-icon at least it looks like that on Samsung Android 12.

Related

When updating Chrome on Android Studio's Emulator, Chrome crashes

I am using Android Studio's device manager to run an emulated android tablet device on my Mac (M1). Specifically, the device targets API 30 and uses the arm64 architecture. By default, this device comes with the Chrome browser, version 91.
My goal is to update Chrome to the latest version possible (as of this post, version 108). Unfortunately, what I've tried either doesn't actually update Chrome or results in Chrome crashing immediately upon start up.
1. Clicking Chrome's Update Button - does nothing
The Chrome browser prompts me to update it, but clicking on this does nothing. The menu just closes.
2. Updating Chrome from the Play Store - can't select my device
I tried going through the Play Store instead. However, when I do this, it prompts me to select a valid device via a dropdown menu, and the emulator is not selectable in this dropdown.
3. Installing the APK via Android Debug Bridge - Chrome crashes
Finally, various places suggest using adb to install a Chrome APK file. This gist summarizes the process (remove old chrome, download the desired APK, and install it via command line).
I believe I'm supposed to download the "arm64-v8a + armeabi-v7a" version, because the architecture must match and my device manager is telling me my architecture is arm64:
When I install via adb, I get the "Success" message, and I can see in the app info on the emulator that Chrome is now version 108. However, when I attempt to turn it on, it crashes immediately.
For what it's worth, I tried every available APK architecture in the list just in case arm64 was wrong, and they all result in the same thing: "Success", but crashing upon startup.
Is it possible to update Chrome on an android emulator? Is there something I may be missing when installing the APK?
Let me know if more info is needed!
So, posting this question was apparently enough info for Stack Overflow to give me a good "Related Questions" list, and I found an answer on Is Google Play Store supported in avd emulators?.
Essentially, only some images support the Google Play Store; I hadn't realized this. That was why my attempts 1 and 2 (update via Chrome or Play Store respectively) didn't work. Once I used an image that supported the Play Store, I was able to update Chrome just fine!
Inconveniently, none of the tablet images support the play store, but there's a workaround.
Getting a Tablet Emulator with Google Play Store
Select an image that supports the Play Store (indicated by the icon in the Play Store column). I was only able to find these in the Phone section.
Download one of the provided system images. We only care that this image is downloaded, and we don't actually need to create this device.
Go back to the Device Manager and find your tablet image. Use its dropdown menu to Wipe Data and then Show on Disk. You may duplicate the image first, but wiping the data is important for the emulator to start on a clean slate.
Clicking Show on Disk should have brought up the files for that image. Locate config.ini and open it.
Change PlayStore.enabled from false to true.
Change image.sysdir.1, replacing where it says google_apis with google_apis_playstore instead. We downloaded this image on Step 2.
Save and start up the emulator. You now have a tablet emulator with the play store enabled!

Android app appears in Battery Optimizations whitelist, but is not actually there

Background:
I am developing an Android app. When the app starts up, it checks to see if it is excluded from Battery Optimizations using the isIgnoringBatteryOptimizations() function. If that function returns false, I use the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission to show the Battery Optimizations Settings screen, where the user is expected to add the app to the whitelist.
This all works perfectly when I run the app from Android Studio. The trouble starts when I download and install the release candidates.
Note that the issue I will describe only happens on one of my two phones. The issue happens on a Sharp 507SH running Android 7.0. The issue does not happen on a Sony SOV32 also running Android 7.0.
The issue:
When I download and install the release candidates (not using Android Studio) and start the app, the Battery Optimizations screen is shown as normal. However, the app appears already listed in the "not optimized" whitelist right away. Normally the user has to manually select the app and add it. But it appears in the list. So the user presses the back button to return to the app and everything seems fine. However, the app is not actually in the whitelist. This is confirmed by the fact that the app prompts the user every time the app starts, i.e. isIgnoringBatteryOptimizations() is still returning false.
I can add the app to the whitelist "for real" by first going in to Battery Settings and removing it from the whitelist, then adding it back. Then the prompts disappear as they should.
I am late to the conversation, but I have experienced something similar to what paperduck said above.
I cannot 100% prove it, but my experience shows that when testing on an emulator and my own device (Huawei P20 Lite), with the application installed via Android Studio, the application says that it is on the Optimisation list. Adding or removing the application from the Optimisation list does not change the returned value.
This may be a side-effect (bug) of previously installing the APK on the phone outside of Google Play. We are downloading and installing APK file release candidates directly from Google Drive. The phone which had a previous APK file installed experiences this problem. The phone which has not had the APK file installed directly before is not experiencing the problem.
We haven't confirmed this. It is our suspicion.

Installing application and uninstalling does not remove completly - Android Studio

I got a strange issue in few of my recent applications.
What I did:
Installing an application either directly using USB cable with Android Studio . Or downloading and installing signed APK through my local server.
Application works fine in all aspects
Uninstalling the application by long press and dragging the app icon to Uninstall icon
Or uninstalling through Settings -> Apps -> Uninstall by selecting the app
Problem:
After uninstall , under Settings -> Apps -> Still the app is shown as below
My application still shows in the list at the bottom with NOT INSTALLED FOR THIS USER message
I am not sure why this is happening. For majority of devices again downloading/installing new APK version from local server does not work unless I again uninstall by clicking on above list and goes to next screen as shown below.
What might be causing this?
Does any other developer faced same issue?
Android Studio Version : 2.1.3
Min SDK in Manifest : 17
Devices Tested : Nexus 4 , OnePlus 3 , Motorolla Gen-3 , Honor
Different Trials Made:
Device is having only one user Owner
Now I have uninstalled an application which was downloaded from App store. This was done successfully without giving an option again with NOT INSTALLED FOR THIS USER
Again complete removal of my application and reinstalling is done. After this , I tried to uninstall again.The same options are shown for my application
NOT INSTALLED FOR THIS USER
Seems to be this is the issue with custom applications and not those installed from App Store. In-fact some steps which probably I am missing. Can anyone point out!!
In Android there is multiuser environment came from Android 4.2,
So when there are multiple user accounts present on the device, and if one user installs the app, it get's installed for all users.
Though when you uninstall it from your user, it's still present in other user.
So it shows that message:NOT INSTALLED FOR THIS USER
To solve this problem, there's are three ways, you can try any one feasible to you:
1. You need to login to that user environment and uninstall the app.
2. Uninstall for all users(you need to be admin user) Go to Settings > Apps, find and open the app info. Then, open the overflow menu (3 vertical dots), and choose Uninstall for all users.
3. You can uninstall app for all users from PC using adb command: adb uninstall on command prompt/shell.
If you have multiple users on your device, which means that the apps are installed by another user,and while you uninstall app the default account is another than this issue occurs
Try this
(from Owner account) Go to Settings > Apps, find and open the app
info. Then, open the overflow menu (3 vertical dots), and choose
Uninstall for all users.
(from PC) Enter adb uninstall on command prompt/shell.
This is the same as "uninstall for all users"

debug android app on chromebook

I have an android app that works on the chromebook flip when using arc welder to install and run it. However, when I download the current version from the play store, or sideload the current dev version by copying over the apk, the app doesn't run. I get the splash screen and then a white screen and nothing happens.
I tried using chrome on the chromebook and doing chrome://inspect/#devices and chrome://inspect/#apps but i don't see my running app in either place. (The app is mostly a webview wrapping a JS application, so this is typically how I debug it). I also tried using the android chrome browser and also do not see my app there. I am not sure where to find the application logs, although I did try looking at the various system logs. The chromebook is in developer mode so I can get a shell and look around, but I couldn't find an app log. adb devices does not show my app, and adb logcat doesn't show anything either.
Anyone know how to debug a webview app on the chromebook?
There is no need to use ARC Welder anymore. Play Store can be installed directly on Chromebook.
Also remote debugging using ADB is possible. Follow instructions from here.
https://developer.android.com/topic/arc/index.html

Signed App cant install on low end tablet

Hi guys, I know most of people faced the problem same like me.
But I still cant solve this problems.
I had build android app and this app is using Google Map API and Google Places API.
I had signed my apk file using Eclipse wizard, but when I transfer it to my tab (taiwan product) using SD Card it said "application not installed". I never installed this app with debug key before. All others Google Map apps I downloaded from Play store can use well in this tab.
I set min android version is 2.2 and highest is 4.0.3. My tab running on 4.0.3.
I also tried to install this app to other brands low end tablet, and it was successful.
But in my tablet, it failed.
Anybody have idea why I can't install this signed apk file? I had tried so much to solve this.
thanks..
There comes a time in every Android user's life where you want to install an app not found in the Android Market. If it's your first time, you're greeted with, "For security, your phone is set to block installation of applications not obtained from the Android Market" message as you try to install. But how do we get there?
To allow app installs from non-Market apps, tap the menu button on your home screen, then choose Settings >> Applications >> Unknown sources.
Who are these "Unknown sources," and what do they want? Simply put, it's anything other than the Android Market. Could be an app sent by e-mail. Or downloaded from a website.
If you're worried about the security implications of allowing unknown sources, there's an easy fix -- install the app from outside the Android Market, and then hit the checkbox again to turn them back off.
source.

Categories

Resources