Empty Package and launch_activity list is displayed on selecting the .apk

Hi everyone, I am new to Mobile automation, I just initiated it with Appium. I have installed all the pre-requisites needed for Appium. However, got stuck in the following issue.

Getting empty ‘package’ and ‘launch_activity’ list on selecting the .apk file.
I checked the path and spaces in the apk file location. Still, not working.

I am using the followings,
Windows 10
Appium.exe 1.4.16.1
JDK 1.8

Also, have set the following paths in the environment variables
User variable
JAVA_HOME C:\Program Files\Java\jdk1.8.0_73\bin

System variable
ANDROID_SDK C:\Android\sdk
path C:\Android\sdk\platform-tools;C:\Android\sdk\tools;C:\Android\sdk\build-tools;%JAVA_HOME%\bin

Please help me in sorting this out.

Thanks in advance.

@Uma: Possible to share the apk file?

Hi,
Please find the apk file in the below link,

Install same apk file on ur handset or emulator,
Open the calabashtest app (app-debug.apk), while on screen it’s displayed, type below commands on cmd
adb shell
dumpsys window windows | grep -E ‘mCurrentFocus|mFocusedApp’

Sorry @Uma, I can’t access dropbox. Possible to share it through any other medium. If you have a git repo, that would be great.

Thank you @sunil That helped me to get the package name and activity in cmd. However, I am unable to get the same in the Appium App. The package field is not editable and only option is to select from the drop down.

I am still getting empty package drop down in the Appium App.
Please let me know if I am missing something?

Sorry @email2vimalraj I do not have a git repo. I have added the .apk file in this link http://cl.ly/3U1G2O3D241j.
Hope it will be accessible.

You don’t have aapt tool configured in your environment.
you can get the package name and the launch activity of an android app by using it.
aapt dump badging <apk path>

aapt tool is inside the build tools folder.

Hi @pr4bh4sh, I have configured the aapt tool in my env. Still the package name and launch activity is not auto populated in the Appium app.

This is the result I get when I run the Appium server.

Thank you guys, the issue is fixed now. :slight_smile: I uninstalled and reinstalled the appium.exe and set up the environment variable for sdk again.

Note: Try this if it is still not working.

  1. Open Appium.exe and choose the APK file path and Device Name.
  2. Close the Appium.
  3. Open cmd and type adb start-server.
  4. Now, open the Appium.exe and see the package name and launch activity are auto populated.

This way worked for me.

2 Likes

Your path to the apk file contains spaces. Thats is why you seeing empty package and launch_activity list on selecting .apk file.

C:\Users\Uma Maheshwan\Desktop\Appium\app-debug.apk

Uma Maheshwan folder should not have space.