How do I launch any application via a terminal or command shell on android emulator engine? For example, if I want to start any game, how do I do via a terminal or command shell?
Anyone could help is really appreciated.
Thanks,
Sam.
You can use the am start command trough adb.
Example for the browser app floating around the internet:
am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity
Related
I am unable to launch Android For work enabled apps from Adb shell command?
Can some one plz give example?
Refer attached screen, I want to launch Playstore app.
Without badge ICON play store app has the same activity info with the badged playstore app as well(com.android.vending/com.google.android.finsky.activities.MainActivity).
And I am unable to launch the Badge play store activity. Please help me.
I have tried by using below command:
adb shell am start com.android.vending/com.google.android.finsky.activities.MainActivity
It is always launching Non-Badged playstore app only.
Then I have tried as per the AFW blog by Google:
https://developer.android.com/work/managed-profiles.html
adb shell pm list users
UserInfo{0:Drew:13} running
UserInfo{10:Work profile:30} running
adb shell am start --user 10 -n "com.android.vending/com.google.android.finsky.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
So, I got the java.lang.SecurityException: Shell does not have permission to access user 10 error. Please someone help me.
I have found a way to launch the Apps.
Make the app in debug mode and add clearUserRestriction of the provision client as below.
dpm.clearUserRestriction(adminName,UserManager.DISALLOW_DEBUGGING_FEATURES
if we have these changes then I am able to launch the Android For Work badged apps by using the below commands. Where the --user 10 is the AFW Provisioned User.
adb shell am start --user 10 -n
"com.android.vending/com.google.android.finsky.activities.MainActivity"
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
I know it is easy ,if I can use adb .
$ export ADBHOST=192.168.11.14(device's IP)
$ adb kill-server
$ adb start-server
in this status.I can use adb with wireless.so next,
$ adb shell am start -a android.intent.action.VIEW http://www.google.com
in this status. I can see google page in my android device .
I want to do it without adb. I want to develop a app which send a intent to one device via tcp without install any app. How can I do it?
You can't. Android doesn't wirelessly accept Intents from other devices, except via adb. It would be 100% insecure to do so- anyone could send any intent to anyone. It would be spam central. You need an app on both devices.
I tried a lot and got
adb shell am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity
for launching browser so I tried the same with gallery and I'm stuck with this
adb shell am start -a android.intent.action.MAIN -n com.sec.android.gallery3d/.GalleryActivity</b><br/>
I know GalleryActivity is not available but what else can i use?
Note: I am using samsung Galaxy S3 mini so the package name is com.sec.android.gallery3d
We can use monkey to open any app through adb shell,
Try the below command,
$ adb shell monkey -p com.android.gallery3d 1
In my nexus4, Gallery app package name is com.android.gallery3d and we are just passing 1 event via monkey, So that monkey will just open the app and will not do anything further.
Also this approach helps you to open any app just with the package name. Monkey will pick the launcher activity by itself.
Hope it helps.
maybe
adb shell am start -t image/* -a android.intent.action.VIEW
also one more thing , this will open the default app selected for gallery in your device.
I want to launch the App Info screen for my app through adb. I tried to fire an intent using "adb shell am start" but nothing seems to work. I need something that works at least for API levels 18 and 19. Can anyone help?
Open App Info
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.your.packagename
For Example: if you want to open Chrome App Info
adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS package:com.android.chrome
adb shell am start -n yourpackagename/.activityname
i want to start an application on the phone through adb tools.
I follow this thread [Link]
[1]: How to start an application using android ADB tools? but, for example if i want to start the Angry Bird game how do i can discover the MAIN activity of package?
Thanks a lot.
If you install the app AppXplore from Google Play, you can inspect your installed applications and learn the package name and the Activities in the APK.
I've verified it just now and it worked by starting Adobe Reader from adb shell:
am start -n com.adobe.reader/com.adobe.reader.AdobeReader
We can start any application using am-:activity manager
adb shell am start android.intent.action.VIEW
adb shell am start com.android.Browser