Add -a android.intent.action.MAIN to the launch command #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request makes a small adjustment to the ADB command used by the plugin to restart or launch an app’s default activity. Previously, the command did not include any explicit action. Now we add
-a android.intent.action.MAIN
so that apps that depend on havingMAIN
set will correctly initialize on startup.Why this change is necessary
In some apps, certain startup logic or navigation flows only kick in if the incoming Intent has
action=MAIN
. Without that action, the app might show a blank screen or skip important setup steps. By explicitly includingandroid.intent.action.MAIN
, we ensure that those apps can use ADB Idea without unexpected behavior.Impact on Other Users
MAIN
action. Adding it explicitly shouldn’t break anything for them.MAIN
, it should work exactly as before. This is simply a more explicit way to handle typical launcher activity scenarios.MAIN
action for initialization will now behave correctly on restart or launch via the plugin.Implementation Details
-a android.intent.action.MAIN
when launching the default activity.Specifically, the plugin retrieves the default activity name via
getDefaultActivityName(...)
, which usesDefaultActivityLocator
to identify the main launcher activity. Change ensures that the final ADB command explicitly includes-a android.intent.action.MAIN
when starting that activity, preserving the intended behavior for apps that rely on MAIN for their initial setup.