SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

Find Launcher Activity And Package Name Of Android App

Previously we learnt different three methods of finding any android application's launcher activity name and package name. Still if you are unable to find launcher activity and package name of any android application then you can use any of bellow given two methods. It will helps you to find any .apk file's package and launcher activity name.

Earlier we already learnt different 3 methods to find android app's package and launcher activity name in THIS POST

Bellow given 2 methods will show you how to get package and launcher activity name of APK Info app. You can download APKInfo App from THIS PAGE if it is not available with you.

PREREQUISITE : PREVIOUS 15 STEPS of appium tutorials should be completed without any error.

Method 4 : Using AndroidManifest.xml
Every .apk file contains AndroidManifest.xml file which contains android app's package and activity name. Bellow given steps will tell you how to open AndroidManifest.xml file and read package and activity name. 

Prerequisites :  1. .apk file for which you wants to get package and activity name. 2. WinRAR should be installed in your PC.
  • Right click on .apk file of APK Info app(or any other .apk file for which you wants to know package and activity name).
  • Select Open with -> WinRAR archiver option from right click context menu.

  • It will open .apk file in WinRAR window and you can see AndroidManifest.xml there as shown in bellow image.
  • Open AndroidManifest.xml file in notepad.
  • Now find keyword "p a c k a g e" In notepad. It will show you package name of your app as shown in bellow image. 
  • Package name for my APK Info app is : com.intelloware.apkinfo
  • Find keyword "a c t i v i t y" In notepad. It will show you activity name of your app as shown in bellow image. 
  • Activity name for my APK Info app is display: .MainActivity. Here you need to append package name ahead of activity name so full activity name is : com.intelloware.apkinfo.MainActivity
Method 5 : Using hierarchyviewer of SDK
Prerequisites :  
  1. Android SDK should be installed and configured as described HERE.
  2. Android emulator should be created as described HERE.
  3. .apk should be installed in emulator as described HERE. I will use APK Info app in this example so i have installed it in my emulator.
hierarchyviewer is a tool provided by android SDK. You will find it(hierarchyviewer.bat) inside tools folder of SDK. Here we will use it to get package and launcher activity name of APK Info app. Follow bellow given steps.

Note : hierarchyviewer is works well with emulators only for me. So try to use it will emulators only.
  • Launch android emulator and open APK Info app in emulator.
  • Open hierarchyviewer.bat file from tools folder of SDK.
  • It will show hierarchyviewer interface. It will show you package and activity name of you app as shown in bellow image.

This way, You can get Android App's Launcher Activity And Package Name.

1 comment:

  1. Hello,

    I am just learning how to utiluize Appium and when launching the script through Eclipse I get the following write error:

    Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: The application at 'C:\Users\mpmor_000\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-debug-androidTest.apk' is not writeable. Please grant write permissions to this file or to its parent folder 'C:\Users\mpmor_000\AppData\Roaming\npm\node_modules\appium\node_modules\appium-uiautomator2-server\apks' for the Appium process, so it could sign the application
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'

    I was on the phone for several hours with windows support and they could find nothing wrong with the permissions setup. The file is open for write. Any suggestions would be welcome!

    Thank you,

    ReplyDelete