Android TV app uiautomator test - android-testing

We are trying to utilize uiautomator testing for your TV applications. But the TV widgets (cards etc) does not respond to click event.
My question is that how can we make sure we navigate (with DPAD keys) to the correct UI widget and 'click' it with DPAD_CENTER?

You can try AndroidViewClient/culebra which supports Android TV.
For example this is one extract of a culebra generated script navigating using keys
device.press('DPAD_DOWN')
vc.dump(window=-1)
device.press('DPAD_DOWN')
vc.dump(window=-1)
device.press('DPAD_LEFT')
vc.dump(window=-1)
device.press('ENTER')
vc.dump(window=-1)

Related

iOS configurable widget dynamic options works in simulator but not device

I'm currently building my first native iOS app with SwiftUI, and part of my app is a widget that displays data from within my app. I have a configurable widget with 3 parameters, one of which uses "Dynamic Options". I used this tutorial to implement this: https://developer.apple.com/documentation/xcode/customizing-the-build-phases-of-a-target
When I run my app in the simulator everything works great, and I am able to load and select a dynamic option as supplied by my IntentHandler, and use that value in my widget. In the simulator everything works exactly as I'd like, and I'm very happy with it.
When I plug in my iPhone running iOS 16 and run the app on my phone from Xcode though, all of my widget settings work, but I get the dreaded "No options were provided for this parameter" for my dynamic option. I'm stumped by this because it works perfectly in the simulator, but won't work on my device.
Are there any obvious gotchas I should be aware of to try and debug this issue?

Programmatically calling siri shortcut from app

I'm currently planning an iOS app that makes use of NFC tags and iOS shortcuts. Idea is that once a NFC tag has been scanned, a shortcut is triggered that executes certain commands and then opens the app. That part shouldn't be an issue, since as far as I understand, one can write the shortcut name into the NFC tag and iOS will then run the shortcut (at least with the newest iPhones).
Once I remove the phone from then NFC tag another shortcut should be executed (iPhone would rest on the sticker for a while and wont enter sleeping mode). Now this is where I'm not sure if that possible. I can detect when the NFC tag is out of reach/cant be read with my app (which is still open when the phone is removed from the NFC tag), but am I able to then call a shortcut once I register the NFC tag is out of reach?
So to sum up the question: can I programmatically call an iOS shortcut from my own app without the user pressing any button on the phone? If not, is it possible when the user presses a button in the app (without leaving the app or launching siri)
From what I have been able to figure out, the only way to programmatically trigger a Siri shortcut is using deeplinks. I followed this article to create an open a URL that runs a certain Siri shortcut. The 2 caveats are that the app opening the URL, your app, must be in the foreground, and the shortcuts app is opened.

Closing Smart App Banner in iOS Appium test

I'm testing a website using Appium for iOS. The site has an associated app and uses Apple's Smart App Banners to promote the app. I'd like to test for the presence of the banner and close it at the beginning of my Appium test, but the banner doesn't appear to exist in the DOM. Is there any way to do this, short of mousing around with a pixel location?
Try to switch to native context:
driver.context("NATIVE_APP");
and check if it contains banner, for quick investigation you can print to console result of driver.getPageSource()

Is there a way to get programmatically UI hierarchy for 3rd party application on iOS?

I am looking for a way to get programmatically UI hierarchy of 3rd party application.
Couple of constrains:
I am looking for a way to get UI of 3rd party app (so I can't include any library in it or change a code)
It should work on a real iOS device (not on Simulator)
It should work with non jailbroken device.
It should work with native app
I am fine with either:
A desktop tool which can access iOS and get info about an app hierarchy
An iOS app which can get UI hierarchy for 3rd party app while being in the background
I am fine with usage of private API (it won't be submitted to AppStore)
Any ideas (even if they aren't complete solution) are welcome.
SparkInspector http://www.sparkinspector.com is similar to Reveal, but I'm not sure is it able to work with real device.
I recommend DCIntrospect: https://github.com/domesticcatsoftware/DCIntrospect
Also there is Reveal: http://revealapp.com
You can inject the Reveal dynamic library into a third-party application using MobileSubstrate. This can only be performed though via a jailbroken device. Blog post describing the process:
http://www.zdziarski.com/blog/?p=2361

How do Apple detect if an iphone app is installed when clicking on a pure html link?

I am trying to detect if my ipad app is installed on a device when visiting my website, in order to suggest different action to the visitor.
Thanks to this post :
https://stackoverflow.com/a/8310348/1128754
I found that the "store" application on iphone seems to have achieve to detect if the app is installed on the device. When you click on store links, it launch the app instead of going to the mobile web version.
For example, if you go to :
http://store.apple.com/xc/anythinghere
with an iphone on which apple store app is installed ( http://itunes.apple.com/app/id375380948 )
it automatically start the store app, instead of the web page.
I tried to follow the stack call with mitmproxy but safari doesn't seems to ask query before launching the app.
So, I guess they did custom url scheme recognition, with http:// links.
Do you think it is possible?
This is done with URL protocol handlers:
http://www.iphonedevfaq.com/index.php?title=URL_schemes#URL_Protocol_Handlers
You cannot detect if an app is installed from HTML, but you can launch an app. For example, the popular game "Doodle Jump" can be launched by going to doodlejump://, but if you don't have it installed, the link won't work. As mentioned, this is done with a custom URL scheme and needs to be coded into your app.

Resources