Appium setup issues

1

Trying to setup Appium with Android but keep getting errors. I have an APK manually installed to an actual device. I have followed the instructions on the error message with no luck.

My Desired capabilities are set to:

>   "appPackage": "com.XYZ.android",   "appActivity":
> "com.XYZ.android.homepage.HomePageActivity",   "platformName":
> "Android",   "deviceName": "Google Pixel 3a",   "udid": "99NBY3DL9K", 
> "automationName": "UiAutomator2",

Get this error:

An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.XYZ.android.debug' 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/pops/Library/Android/sdk/platform-tools/adb -P 5037 -s 99NBY3DL9K shell am start -W -n com.XYZ.android.debug/com.XYZ.android.homepage.HomePageActivity -S' exited with code 255'; Stderr: 'Exception occurred while executing 'start': java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.XYZ.android.debug/com.XYZ.android.homepage.HomePageActivity } from null (pid=7171, uid=2000) not exported from uid 10304 at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1043) 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:1334) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:3671) 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:10504) at android.os.Binder.shellCommand(Binder.java:929) at android.os.Binder.onTransact(Binder.java:813) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:5053) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2867) at android.os.Binder.execTransactInternal(Binder.java:1159) at android.os.Binder.execTransact(Binder.java:1123)'; Code: '255' ...

android
appium
asked on Stack Overflow Feb 13, 2021 by Kam ahmad

1 Answer

0

Enable Developer:

Navigate to Settings>About and click Build Number multiple time

Enabled Remote Debugging:

Goto Settings>System>Developer options>Debugging>USB Debugging and enable it:

enter image description here

Connect phone to laptop usb:

Now search for device:

Open cmd and run:

adb devices

You will get prompt in phone for authorization accept it:

enter image description here

Select always allow from this computer

The output of abd devices command should be like:

enter image description here

Accept the prompt and execute the command till you get device instead of unauthorized as output of the command:

Note:

if you are not getting above prompt then , click revoke ub authotization Then switch off developer mode using the toogle button and then start the process again from Enable Developer mode in Oneplus:

Read more detailed answer at :

https://praveendavidmathew.medium.com/how-to-connect-oneplus-6-to-appium-studio-72b35609b8f0

answered on Stack Overflow Feb 15, 2021 by PDHide

User contributions licensed under CC BY-SA 3.0