I suggest you to use adb (Android Debug Bridge) tool (part of Android SDK). So, install application under test on target Android device or emulator. And you should run application to get current activity and package name. So, after running app execute the following commands from command line (android-sdk/platform-tools/adb):
adb shell dumpsys window windows | grep -E 'mCurrentFocus|FocusedApp'
And you will get something like this:
mCurrentFocus=Window{43270790 u0 com.estrongs.android.pop/com.estrongs.android.pop.view.FileExplorerActivity}
mFocusedApp=AppWindowToken{44d67b88 token=Token{435e5990 ActivityRecord{434ee320 u0 com.estrongs.android.pop/.view.FileExplorerActivity t133
So, current activity is com.estrongs.android.pop/.view.FileExplorerActivity and application package name is com.estrongs.android.pop is this case.
Steps:
- Install apk on device or emulator
- Run application
- Execute
adb shell
from command line
- Execute command to get current activity from device(shell) shell:
dumpsys window windows | grep -E 'mCurrentFocus|FocusedApp'
I hope it helps you.