-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List and launch apps faster, add option to launch new instance, show app suggestions #5572
base: dev
Are you sure you want to change the base?
Conversation
Thank you for the PR. I didn't read the details, but could you explain a bit why this new method would be preferable (benefits/drawbacks)? Here are some differences I observed between current scrcpy and the current version of this PR. System apps are not listed separately. Some items do not appear with this PR. For example:
Some items have a different name. With current scrcpy:
With this PR:
The packages having the same label appear only once. With current scrcpy:
With this PR:
|
Hello😊 This will instead list the apps available to launchers alphabetically. scrcpy/server/src/main/java/com/genymobile/scrcpy/device/Device.java Lines 244 to 257 in 6f323a2
The missing labels if there are duplicates are now fixed in this commit: f8c32cf In my device, the label for The benefit with this approach is that time can be shaved off because every time trying to launch an app or just build list, we no longer need to go through every installed application (which some system apps are not launchable), and filter it ourselves: scrcpy/server/src/main/java/com/genymobile/scrcpy/device/Device.java Lines 258 to 268 in 45382e3
This mainly is for user-convenience (for me at least). I am planning on adding an option to specifically launch a specific activity, some activities of apps are exported. Even system ones that can't normally be launched from main default launcher. For this, I propose another list type, maybe "expert?" --list-apps=expert (unimplemented). This will instead go through all installed apps, check every activity if exported or not, then add to list. This one may take a long time to build the list. I have been using Activity Launcher myself to directly launch to specific activities.
Must be surrounded with single quote to escape Edit: |
Hello @rom1v, I have made possible to show suggestions if there's no exact match for labels/package names, exact names and alike. The list refers to the same apps that are listed in launcher app drawers. For example, if there are multiple apps installed with "Camera" in its label, it will show this:
Same goes for packages names:
Package names can never contain spaces. This PR now also allows treating string passed to For example, scrcpy --start-app="Play Store" is allowed, treated as label instead as package name though "?" was not indicated. Previously, even if full app label is not entered, app with the closest label and is unique will still launch. I don't know if that is by design, but this PR requires full unique label/package name (no ambiguity). In the original version, several queries need to be made before the app gets launched. Mainly, this method gets called scrcpy/server/src/main/java/com/genymobile/scrcpy/device/Device.java Lines 242 to 249 in 45382e3
And when finally launching the app, because only package name is provided to Device.startApp,
Approach in this PR instead gets the already filtered intents. The system does it for us. And since this only limit to the list of apps that are visible in default launcher, there'd be no need to get the launch intent for all packages in the system. |
PR5572_v3.0.mp4original_v3.0.mp4 |
I have noticed that some apps are missing from each other, even have different label as mentioned (Play Store vs Google Play Store). Current scrcpy drops also some items that are normally listed in app drawer. Drive, Facebook, and Maps for example. Screen recording above includes the approximate duration at the bottom. Current scrcpy takes almost twice as long, if not more, compared to this PR. The difference can also be felt when launching apps in main display and virtual display. |
I just tested, it's not faster for me. In the current scrcpy version, what takes time in is to call String name = pm.getApplicationLabel(appInfo).toString(); In your PR, it's the same (
Or did I miss something? |
Hello @rom1v ignore this mess 😅 If resolving apps available to "launchers," label may differ |
Show exact matches + other app labels with the keyword
Look for the app from
pm.getInstalledApplications()
(may take time) if not found in drawer. Also if string provided are with spaces, "?" may be dropped. If without spaces, "?" is still required to differentiate with package names. Package names can never have spaces.Recognize system apps but ignore if they don't have a launch intent.
Try launch a new instance. App must support like Chrome, Samsung Gallery & Calculator, etc
Force stopping an app changed to
-
to accommodate+
for new instance feature.--list-apps
list drawer apps and does so almost twice as fast than previous. Also launching apps in main display or new display are faster, as long as the apps are found from app drawer.Edit: document changes instead