I have samsung with installed android 6.0 (default 4.4.4) - it's very slowly device, so I ordered and waiting for Samsung A7 (android 8.0 Oreo). I try launch apps by programically (without additional app from google play). When I put code to folder init.d I can turn on and turn off my phone when phone is charging/isn't charging.

Now I want launch app from google play, I found method:

am start -n packagename/android:name -a android.intent.action.VIEW

I receive packagename and android:name from AndroidManifest.xml using android studio, and added to method above to file in folder init.d, but it didn't works.

How can I launch app (e.g. youtube, googlemaps, facebook, discord) by code?

  • 1
    Have you tested if the used am start commands works via adb? Because your android:name doesn't seem correct, at this point you have to specify the activity class name to be started not the app name.
    – Robert
    Sep 21 at 11:16
  • Ok @Robert, yes, in adb didn't work too. Can you give me advice, where can I receive packagename and android:name, e.g. facebook app? Sep 21 at 14:01
  • As I wrote you don't need any android:name but the activity class name, so you need an entry of an <activity .. >` entry. Typically the one that contains in one of it's child elements the entry <category android:name="android.intent.category.LAUNCHER"/> .
    – Robert
    Sep 21 at 14:12
  • thank you very much @Robert, of course it works correctly. 1.I asked where can I find activity android:name, always I have to download app to computer and looking for this information using android studio? 2.I have another problem, I have to waiting until the phone turns on, Where I find DOCS with methods, how I can do it? Sep 21 at 15:06
  • On Android it is possible for apps to access AndroidManifest.xml of other installed apps. So there are AndroidManifest.xml viewer apps or even apps that list activities of other apps. Unfortunately I don't use such apps so I can not tell you which one to use.
    – Robert
    Sep 21 at 17:50


You must log in to answer this question.

Browse other questions tagged .