With ADB how to open a given app on a given display without specifying an activity?
Aug 30, 11:04pm
To open a specific app on a specific display using ADB (Android Debug Bridge) without explicitly specifying an activity, you can use the am start command with the package name of the app and the --display flag to target a specific display.
Command Syntax:
bash
adb shell am start -n <package_name> --display <display_id>
Explanation:
<package_name>: Replace this with the package name of the app you want to open (e.g., com.example.app).
<display_id>: Replace this with the ID of the display you want the app to open on (e.g., 0 for the primary display, 1 for a secondary display, etc.).
Example:
If you want to open the app with the package name com.example.app on display 1, use:
bash
adb shell am start -n com.example.app --display 1
Notes:
Package Name: Ensure you know the package name of the app. You can find it using:
bash
adb shell pm list packages
This lists all installed packages on the device.
Display ID: The display ID is typically 0 for the primary display. For secondary displays, it could be 1, 2, etc. You can check available displays using:
bash
adb shell dumpsys display
No Activity Specified: The -n flag is used to specify the component (package/activity) to start. If you omit the activity, the system will use the default activity for the package.
Permissions: Ensure your device is authorized for ADB debugging and that USB debugging is enabled in the developer options.
Aug 30, 11:04pm
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.