get launchable activity name of package from adb
You don't need root to pull the apk files from /data/app
. Sure, you might not have permissions to list the contents of that directory, but you can find the file locations of APKs with:
adb shell pm list packages -f
Then you can use adb pull
:
adb pull <APK path from previous command>
and then aapt
to get the information you want:
aapt dump badging <pulledfile.apk>
How to fetch package-name and launcher activity from Android apk
Android Aapt provides this feature. Use below commands
a)package :
D:\Android\sdk\build-tools\23.0.2>aapt d badging Apk-path\apk-name.apk |grep package
b)launchable-activity:
aapt d badging Apk-path\apk-name.apk |grep launchable-activity
How to start an application using Android ADB tools
adb shell
am start -n com.package.name/com.package.name.ActivityName
Or you can use this directly:
adb shell am start -n com.package.name/com.package.name.ActivityName
You can also specify actions to be filter by your intent-filters:
am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName
How to determine if a package name is a service or launchable GUI app
adb gives you list of preinstalled applications. These applications may contain activities, services, content providers, and/or broadcast receivers. When you say "real app", you are asking for applications with activities. Even if you knew which application contains activities, you still need to find the name of that activity before you can launch it.
So to get what you want, it is going to be few more steps. The answer below describes what you need:
https://stackoverflow.com/a/12700063/4406743
Basically, you need to go through each application that you are interested in, pull it to the PC and get it details using aapt. aapt will provide you all the details needed for launching any activities in that application.
How to start an Android application from the command line?
adb shell
am start -n com.package.name/com.package.name.ActivityName
Or you can use this directly:
adb shell am start -n com.package.name/com.package.name.ActivityName
You can also specify actions to be filter by your intent-filters:
am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName
Install and open package through adb
Through adb you can simplify the app opening process by using monkey from adb itself without needing to find the launchable activity.
For example, to open Facebook:
adb shell monkey -p com.facebook.katana 1
Find package name for Android apps to use Intent to launch Market app from web
It depends where exactly you want to get the information from. You have a bunch of options:
- If you have a copy of the .apk, it's just a case of opening it as a zip file and looking at the AndroidManifest.xml file. The top level
<manifest>
element will have apackage
attribute. - If you have the app installed on a device and can connect using
adb
, you can launchadb shell
and executepm list packages -f
, which shows the package name for each installed apk. - If you just want to manually find a couple of package names, you can search for the app on http://www.cyrket.com/m/android/, and the package name is shown in the URL
- You can also do it progmatically from an Android app using the
PackageManager
Once you've got the package name, you simply link to market://search?q=pname:<package_name>
or http://market.android.com/search?q=pname:<package_name>
. Both will open the market on an Android device; the latter obviously has the potential to work on other hardware as well (it doesn't at the minute).
Related Topics
How to Show One Layout on Top of the Other Programmatically in My Case
Android-L Cardview Visual Touch Feedback
How to Draw Border on Just One Side of a Linear Layout
How to Get Toolbar from Fragment
Sqliteopenhelper Onupgrade() Confusion Android
Android Preferences: How to Load the Default Values When the User Hasn't Used the Preferences-Screen
How to Extract Code of .Apk File Which Is Not Working
Reusing Fragments in a Fragmentpageradapter
How to Create an Animated Gif from Jpegs in Android (Development)
Restrict Edittext to Single Line
How to Import Set of Icons into Android Studio Project
How to Create an Avd for Android 4.0
How to Use Room Persistence Library with Pre-Populated Database
Remove Vertical Padding from Horizontal Progressbar
Why Does It Take So Long for Android's Mediaplayer to Prepare Some Live Streams for Playback