How to Get App Package Name on Android [3 Methods]
In this guide, we will share three different methods to get the package name of all the installed apps on your Android device. The apps installed on your device are labeled via two different methods. The first one is the general name that you usually come across such as Facebook, WhatsApp, etc. These are the name that the everyday users deals with and searches for on Play Store.
On the other hand, there’s an associated application ID or app package name, which acts as a unique identifier for each app. For example, Facebook has the package name com.facebook.katana and WhatsApp has com.whatsapp. These are the names used by backend people and developers alike. Furthermore, while you may come across many apps on the Play Store by the name of Facebook, but none could have the com.facebook.katana as their package.
So if you have ever any doubt regarding the app’s authenticity, then you may count on this factor. With that said, how could you get hold of the package name of all the installed apps on your Android device? Well, there are three different methods for the same, and in this guide, we will make you aware of all these three approaches. So without further ado, let’s get started.
Table of Contents
Method 1: Get Android App Package Name via Play Store URL
This method is extremely easy to execute. However, if you are looking to get the name of various installed apps in one go, then it would require quite a lot of manual effort. But for a few apps, this should be your go-to method. Here’s how to use it:
On PC
- First off, head over to the Play Store website on your PC.
- Now search for the desired app (as an example, let’s go with Facebook)
- Then head over to its search bar and check out its URL, it will be something along this line:
- As an example, in the case of Facebook, the URL will be
- Now the portion after be the app’s package name. So for Facebook, it turns out to be com.facebook.katana.
So this was the first method to get the app package name via Play Store and PC. Let’s see how to try out this Play Store trick on your phone.
On Mobile
- Open the Play Store app on your device and search for the desired app (let’s say WhatsApp).
- Under the app listing’s page, tap on the overflow icon situated at the top right and select Share.
- Now just share/save this URL anywhere you wish. The URL will be of the same format as mentioned above, i.e.
- As an example, in the case of WhatsApp, the URL turns out to be
- As before the app package name will be the portion after So for WhatsApp, it turns out to be com.whatsapp.
The other method involves opening the Play Store website on your smartphone browser, changing its view to Desktop Mode, and then getting hold of the URL. With that, we round off this first method to get the package name of all the installed apps on your Android device. Let’s now turn our attention towards the other two methods.
Method 2: Get Android App Package Name via a Third-Party App
The benefit of this method is the fact that you require minimal effort. Furthermore, it is able to display both the user installed as well as system apps. The UI is also user-friendly. However, I have never been in favor of using third-party apps and giving them access to my device, unless it is of paramount importance. With that said, if you wish to try it out, then follow the below instructions:
- To begin with, download the App Package Viewer 2.0 from Play Store.
- Then launch it and select the desired app from the list.
- Now tap on that app’s name and you should get its associated package name.
That’s it. This is perhaps the easiest method to get the package name of all the installed apps on your Android device. Now let’s check out the third and final method to carry out this task.
Method 3: Get Android App Package Name via ADB Commands
The benefit of this method is the fact that apart from getting the app’s package name, you could even remove the user-installed and system-installed apps on your device via these ADB Commands. Without Root! On the flip side, this method requires a few prerequisites and some level of technicalities as well. But if you are ready to challenge your inner-geek, then this method is tailored made for you. Follow along.
- To begin with, download and install the Android SDK Platform Tools on your PC. These are the official ABD binary files provided by Google.
- Extract its content to any convenient location on your PC and you should get the platform-tools folder.
- Now head over to your Android device and enable USB Debugging. This will make your device recognizable by your PC in ADB mode. So head over to Settings > About Phone > Tap on Build Number 7 times > Go back to Settings > System > Developer Options > Enable USB Debugging.
- When that is done, connect your device to the PC via USB cable. Make sure USB Debugging is enabled.
- Then head over to the platform-tools folder, type in CMD in the address bar, and hit Enter. This will launch the Command Prompt.
- Now type in the below command in the CMD window and hit Enter:
Then type in the below command and you should get a list of all the installed apps:
List of Apps on my OnePlus 7T. View Full-Size Image
That’s it. With this, we conclude the guide on how to get the package name of all the installed apps on your Android device. We have shared three different methods for the same, do let us know in the comments which one you ultimately settled for.
About Chief Editor
Sadique Hassan
A technical geek by birth, he always has a keen interest in the Android platform right since the birth of the HTC Dream. The open-source environment always seems to intrigue him with the plethora of options available at his fingertips. “MBA by profession, blogger by choice!”
Источник
Полный список
— разбираемся, что такое Package для приложения
Package можно перевести как пакет. Этот вариант перевода я и буду использовать в уроке.
Пакет приложения мы прописываем в визарде создания приложения.
Потом его можно найти в манифесте.
Он же по дефолту становится пакетом для Java-классов
Как-то не особо значимая цель .
Может быть он используется как-то еще? Оказывается да. Более того, пакет — это крайне важная вещь при создании приложения. Пакет является идентификатором приложения в системе. Т.е. когда вы устанавливаете приложение, система смотрит его пакет и ищет уже установленное приложение с таким пакетом. Если не нашлось, то все ок и приложение устанавливается.
А вот если нашлось, то тут в дело вступает механизм подписи приложения ключом, который мы рассмотрели на прошлом уроке. Система проверяет, если установленное и устанавливаемое приложения подписаны одним и тем же ключом, то, вероятнее всего, это означает, что оба приложения создал один автор. И устанавливаемое приложение является обновлением установленного, т.к. их пакеты и ключи одинаковы. Система устанавливает новое приложение, заменяя старое — т.е. обновляет старое.
Если же система определила, что приложения были подписаны разными ключами, то это значит, что приложения были созданы разными авторами, пакеты совпали случайно, и новое вовсе не является обновлением старого. В этом случае при установке нового, старое было бы заменено, а значит потеряно (а не обновлено), т.к. приложения абсолютно разные. И система не дает поставить новое приложение, пока не будет вручную удалено старое.
Проведем пару тестов. Я создам два приложения Package1 и Package2 с одинаковым пакетом.
Установлю первое. Оно появилось в списке.
Теперь не удаляя первое, установлю второе.
Первое исчезло. Осталось только второе.
Система решила, что второе является обновлением первого (т.к. пакеты и ключи совпадают), поэтому первое благополучно снесла и заменила вторым. Собственно, это и происходит при обычном обновлении.
Теперь подпишу Package2 другим ключом, чем оно было подписано изначально и попробую обновить через adb.
Параметр r здесь означает, что приложение надо переустановить, если оно уже существует.
Видим ошибку Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]. Система сверила ключи у установленного и устанавливаемого приложений, увидела, что они разные и решила, что это будет не обновление, а просто приложение от другого разработчика ломится с тем же пакетом. И вполне разумно решила не удалять имеющееся приложение, а предупредить пользователя, что не совпадают ключи.
Если закинуть это приложение на эмулятор и поставить через файловый менеджер, получим примерно то же сообщение.
Из вышесказанного можно сделать следующий вывод: ваш ключ, которым вы подписываете приложение ни в коем случае нельзя терять или давать кому-либо.
Если вы ключ потеряете, то ваше приложение навсегда потеряет возможность быть обновленным. Даже если вы создадите новый ключ с тем же алиасом, паролем и данными владельца, это все равно будет другой ключ. И подписанная им следующая версия приложения будет рассматриваться системой не как обновление, а как попытка приложения от другого разработчика заменить ваше приложение и не даст его установить, пока не удалите установленное.
Если же вы ключ кому-то предоставите, то этот человек сможет сделать обновление для вашего приложения без вашего участия. И если этот человек имеет доступ и к вашей учетке разработчика в маркете, то он сможет залить туда свою версию вашего приложения.
Также не забывайте пароли от хранилища и от ключа. Это будет равносильно тому, что вы потеряли ключ. В общем, относитесь к вашим ключам со всей серьезностью.
И в конце урока небольшой ликбез. Пакет имеет еще одно значение. Как вы уже наверно заметили по вкладке Devices в Eclipse, пакет используется в качестве имени процесса, в котором запускается приложение. При этом, под каждое приложение система создает пользователя. Это позволяет разграничить доступ к данным. Каждое приложение запускается и работает со своими данными в отдельном процессе под отдельным пользователем. Соответственно, другие приложения не имеют к этим данным доступа, т.к. запущены под другими пользователями.
На следующем уроке:
— разбираемся с ViewPager
Присоединяйтесь к нам в Telegram:
— в канале StartAndroid публикуются ссылки на новые статьи с сайта startandroid.ru и интересные материалы с хабра, medium.com и т.п.
— в чатах решаем возникающие вопросы и проблемы по различным темам: Android, Kotlin, RxJava, Dagger, Тестирование
— ну и если просто хочется поговорить с коллегами по разработке, то есть чат Флудильня
— новый чат Performance для обсуждения проблем производительности и для ваших пожеланий по содержанию курса по этой теме
Источник