Encountered "java.lang.SecurityException: Permission Denial: starting Intent'. " on real device, but not on emulator - appium

I think the issue java.lang.SecurityException: Permission Denial: starting Intent'. has been addressed in several posts, but my circumstances are different. I am testing a 3rd party mobile app (so adding the android:exported="true" is out of the question), using Appium v1.15.1.
1st Scenario :
Connect to a real device (mobile and tablet). Using Appium, I cannot start session to replicate the app in order to check for the element's location. Appium logs shows this issue java.lang.SecurityException: Permission Denial: starting Intent
2nd Scenario :
COnnect to emulator (LDPLayer4). Using Appium I can start session and the mobile app is replicated in Appium. I can start to check the elements' locator.
I am just wondering what causes the behaviour in scenario 1.

Related

"Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context .." with PWA on iOS

I am currently facing an issue while implementing Web Share API (Level 2) in Vue 3 using it to share/download images on iOS 14 (as experimental feature) and iOS 15 in a Progressive Web App context.
Observation: When the application is running directly in the Browser (not in the PWA Context - which is a local PWA accesible through the homescreen Bookmark on iOS), it also works as expected without any errors.
Installed as a PWA, however, sharing works as expected THE FIRST time, but AFTER saving the image, it refuses to trigger the native sharing mecanism with the error message (note it ALWAYS works once):
Unhandled Promise Rejection: NotAllowedError: The request is not
allowed by the user agent or the platform in the current context,
possibly because the user denied permission.
The navigator.share is triggered directly by a click event, the resource is also loaded in advance and sharing.
It seems to work fine on Android Devices as expected but on IOS
This seems to be (again) a regression of an old WebKit bug. In the past, this was repeatedly reported, for example as WebKit bug #216913 or WebKit bug #218156.
Please report this to the WebKit team, providing the exact iOS and Safari version you encountered this on. Feel free to use this demo app that I have prepared, it's an installable PWA and showcases the Web Share API.

How to check if an app is running in iOS device from a mac terminal

I am trying to launch ios app from python script/terminal using ios-deploy. This is a test app so it might crash and need to relaunch multiple times.
I want to check if this app is currently running or not on the connected device, for my relaunch logic to work. But I am kind of stuck here.
I know idevicesyslog which can capture logs and then parsing logs I can check if my app is currently running or not. But isn't there any sophisticated way to just check if an app is currently running or not in device. Xcode/instruments can get the list of processes via GUI in connected device but I want a command line utility so that I can take certain action.
You can check app or debug app using safari.
Open safari.
And If develop option not available on top navigation bar then open preferences of safari and in advance tab tick show develop option in below that screen.

How can my iOS app know Appium is running it?

One of the benefits of Appium is that I can run tests against the app without compiling in any instrumentation. But, there's a feature I want to turn off in my app when Appium is the user.
How can Appium can send information directly to the app, to tell it that Appium is driving? This needs to happen shortly after launch, so hiding a secret switch somewhere is not a good option.
You can use the processArguments capability to pass application launch arguments through Appium to your application. Inside your application you can read the launch arguments and values using NSUserDefaults.

Worklight 6.1 "access to protected services is denied" after app is deployed to App Store

I have deployed an app to the Apple App store. Local and on device testing went fine, but when the app is loaded from the App store onto an iOS 7.1 device, the user receives a Access to Server is Disabled - Login Failed dialog, followed by a solid white screen.
Looking at the phone console log, the following error appears:
backboardd[31] <Error>: HID: The 'Rate Controlled' connection '<application name>' access to protected services is denied.
Searching on Apple developer forums and StackOverflow show others having similar issues over the past few weeks, but with no clear resolution. This one in particular notes the same issue and that it may be related to Cordova: HID: The 'Rate Controlled' connection 'app' access to protected services is denied
If I turn off the Worklight Server, the app gives a standard Connection Failure message and continues to work properly in Offline Mode, except for any features that call server adapters.
Server and Worklight Studio are running Consumer Edition.
Not sure if this is an app specific code issue, a permissions problem in iOS, or a core conflict between Cordova and iOS 7.1 (yesterday's 7.1.1 shows the same issue).
Any ideas?
It turns out the 6.1.0.1 fixpack installation was not completing properly. While it looked ok at installation, if you watched the logs carefully, there were errors about halfway through. This may have been due to trying to upgrade a deployed app that was already on 6.1.0.1. Since the server only had the one app deployed, we undeployed and removed the app and associated war file. This allowed the fixpack to complete installation correctly.
Next, after re-deploying the app (same war file), to the server, we still got a protected services is denied error, but it no longer said “Rate Controlled”. The device error log then started reporting a version issue. The App Store app and the server version were both supposed to be “2.1”, but after we re-deployed the server version with “2.0”, the app started communicating with the server and adapters.
Finally, we still have an issue that the iOS version is not triggering direct updates for the app (same code, Android version does work properly). We have not yet needed an update, so will test this on our next App Store push.

Guided Access App not available

I'm sometimes getting an error when starting my 'Guided Access' app which is locked down on the iPad using 'Apple Configurator'.
It mostly happens after a hard reset, but not always. The error on screen is:
Guided Access App not available.
There's also a suspicious looking console entry which says:
Warning: |GuidedAccess|error| Springboard server could not disconnect from frontmost app message service gracefully: (null)
I'm not getting stuck in the guided app like many other threads reference, I'm getting this when resetting the iPad. Tried google but found nothing

Resources