I’m having a problem launching a few specific apps in the emulator and in Android Inspector. This same process is working successfully for several other apps, but there are a few that don’t work. Wondering if anyone has faced this and might know how to proceed.
This is for the Trello app, trying to launch into the Welcome/Log In screen:
From the terminal, I am running this command to determine the app package and app activity:
adb shell dumpsys window | grep -E 'mCurrentFocus'
mCurrentFocus=Window{9ae684d u0 com.trello/com.trello.feature.authentication.WelcomeActivity}
I’m then using this command to try to launch the trello app from the terminal:
adb -P 5037 -s emulator-5554 shell am start -W -n com.trello/com.trello.feature.authentication.WelcomeActivity
That command works to launch multiple other apps I’m using, but it is not working so far for a few apps I’ve tried, e.g. Trello and VRBO.
Instead of the app launching, I get this error in the terminal:
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.trello/.feature.authentication.WelcomeActivity } from null (pid=13084, uid=2000) not exported from uid 10154
at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1032)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:999)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:669)
at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1338)
at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:3687)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:539)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:186)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10520)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5027)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2883)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
If I try to launch the VRBO app in Android Inspector session with the following capabilities: (similar capabilities and error for Trello app also)
{
"platformName": "android",
"appium:platformVersion": "11",
"appium:deviceName": "sdk_gphone_x86",
"appium:automationName": "UIAutomator2",
"appium:appPackage": "com.vrbo.android",
"appium:appActivity": "com.vacationrentals.homeaway.activities.MainActivity"
}
…I get this error:
Failed to create session.
An unknown server-side error occurred while processing the command.
Original error: Cannot start the 'com.vrbo.android' application.
Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting.
Original error: Error executing adbExec.
Original error: 'Command '/Users/daniel/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell am start -W -n com.vrbo.android/com.vacationrentals.homeaway.activities.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000' exited with code 255';
Command output: Exception occurred while executing 'start': java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.vrbo.android/com.vacationrentals.homeaway.activities.MainActivity } from null (pid=13420, uid=2000) not exported from uid 10162 at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1032) at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:999) at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:669) at com.android.server.wm.ActivityTaskManagerService.startActivityAndWait(ActivityTaskManagerService.java:1338) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:3687) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:539) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:186) at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98) at android.os.ShellCommand.exec(ShellCommand.java:44) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10520) at android.os.Binder.shellCommand(Binder.java:929) at android.os.Binder.onTransact(Binder.java:813) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5027) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2883) at android.os.Binder.execTransactInternal(Binder.java:1159) at android.os.Binder.execTransact(Binder.java:1123)
But similar to launching from the terminal, I am able to use this same process to launch several other apps in Android Inspector sessions.
Is there a known issue where some apps just won’t launch this way? Or they really need slightly different app package and app activity values than what’s being returned from this command?
adb shell dumpsys window | grep -E 'mCurrentFocus'
The appium trouble shooting docs suggest the following:
Such error might be the indication of the fact that the combination of application package and activity name, which has been passed to Appium as appPackage
/ appActivity
(or auto detected implicitly), is not the correct one to start the application under test. As a solution, it is necessary to check the correct values with the application developer
But as I’ve shown above, I believe I am correctly passing in the app package and app activity values.
Any ideas or help would be much appreciated, thanks!