To start a specific Android app on a given display using adb, you can use the am start command with the --display option. Here’s how you can do it:
adb
am start
--display
adb shell am start --display <DISPLAY_ID> -n <PACKAGE_NAME>/<ACTIVITY_NAME>
<DISPLAY_ID>
1
2
<PACKAGE_NAME>
com.example.app
<ACTIVITY_NAME>
.MainActivity
Suppose you want to start the app with package name com.example.myapp and activity com.example.myapp.MainActivity on display 2:
com.example.myapp
com.example.myapp.MainActivity
adb shell am start --display 2 -n com.example.myapp/com.example.myapp.MainActivity
To list available displays, use:
adb shell dumpsys display
Look for the mDisplayId field in the output.
mDisplayId
This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.
Vibe can make mistakes. Check answers. Learn more