Android accessibility service is restarted while taking adb uiautomator dump - android-uiautomator

I have created my custom accessibility service for my project. Once it is enabled it is working well and serving my purpose. I need to take a dump for certain requirement. But when I take a dump using adb uiautomator command, Android system is disabling and re-enabling accessibility service.
I didn't find this behavior documented anywhere. Is there any workaround to stop Android system from disabling service ?

No there is not. Older versions of Android have a limitation. Only one service can attach to the Accessiblity APIs at a time. For example, if you attempted to turn on TalkBack while your service was on, you would see similarly poor behavior. Either TalkBack would not turn on, or your service would crash.
UIAutomator Heirarchy scanners depend on accessibility services as well as other automated testing features. This is a platform limitation and nothing you can overcome without purchasing a new device/running on a newer OS level. I believe this limitation is gone in Marshmallow, but it might be N or L.

Related

How to disable SIP on macOS VMs for macOS UI testing in CI/CD environment?

I have been trying to run my macOS UI tests on a remote machine(VM), and it does not work. On a local machine, it works after giving the permissions related to accessibility. After digging through, I realised that you need to have SIP disabled and add the relevant permission.
So, how can I disable SIP on a headless machine in a CI/CD?
Unfortunately, it is not possible to disable SIP on a remote machine. You have to boot in safe mode and disable it from the terminal. And that requires direct access to the machine.
You can ask your provider if they can disable SIP for a specific machine for you, or you can look for providers that do.
There are a few out there, with Codemagic being one of them.
We released SIP disabled macOS images with the latest and beta Xcode versions so you can run macOS UI tests without any extra configuration.
It was frustrating not being able to test the UI of a Mac app, but I’m happy with what we managed to release.
I also wrote a blog post if you are interested in getting started with macOS UI testing.
Full disclosure - I’m a DevRel at Codemagic CI/CD, focusing on helping the community build for Apple platforms.

Control installation depending on platform in MSIX package

I have added desktop extension to my UWP app that gives some extra functionality if it runs on Windows 10 desktop platforms. But for other platforms it won't be used. Hence I want to make sure that the desktop extension isn't installed on other platforms thereby saving users some disk space. I have looked into app extension but it won't be viable for my use cases since the UWP app and desktop component communicate via named pipes and memory mapped files. Is there any other way I can control the installation of desktop component depending upon the platform it is being installed??
Update 1
From researching further I have found that this should be possible with optional packages/related sets, to be accurate related sets for my scenario. The examples provided in docs only show scenarios for packaging uwp apps as related sets and no example for packaging win32 apps as related sets was given. Is there any way to package a win32 application as related sets??

Is there a way to add the Network Extensions capability to a macOS app without joining the Apple Developer Program?

I want to build a macOS app that filters specific network requests so I need to add the NetworkExtensions capability. But after I add a NetworkExtensions capability, I get the following message:
Your development team, "Potato Dev2", does not support the Network Extensions capability.
Image of where the above message is from: https://i.stack.imgur.com/H46gE.png
From Apple's documentation on "Adding Capabilities to Your App":
The platform, and whether you're a member of the Apple Developer Program, may limit the capabilities available to your app
The documentation doesn't explicitly say which capabilities require being a part of the Apple Developer Program. I also don't see why I'd need to be a part of the Apple Developer Program to write software on and for my own computer. Note that, at least to my knowledge, the NetworkExtensions capability does not depend on any service from Apple (as opposed to HealthKit or Game Center).
So is there a way to add a Network Extensions capability to a macOS app without joining the Apple Developer Program?
You should be able to do it if you disable system integrity protection (SIP) on your Mac (csrutil disable in the Terminal in the macOS Recovery Environment), and disable amfid's entitlements check by adding amfi_get_out_of_my_way=1 to the kernel's command line arguments. (Again in the recovery environment, nvram boot-args='amfi_get_out_of_my_way=1')
You will need to bypass Xcode when code signing and use the codesign command directly because Xcode performs the provisioning profile entitlements check, as you noticed. codesign itself does not perform this check.
This works for basically allowing just about anything to do with DriverKit system extensions, so I'd expect it to work with Network System Extensions as well.
I figured out the answer to my question: to write macOS software that uses the NetworkExtension APIs, you must be a member of the Apple Developer Program ($100/year). See https://developer.apple.com/support/app-capabilities/ for details.

Integrating altbeacon with BluetoothCrashResolver

I have an app that uses the altbeacon Android Beacon Library to do iBeacon monitoring and ranging, and I'm trying to handle the "Bluetooth share has stopped" crash.
I've followed the instructions to copy in the BluetoothCrashResolver class seen here (https://github.com/RadiusNetworks/bluetooth-crash-resolver) and initialize it in the class that does the ranging. My question is, how do I expose the proper BluetoothDevice and BluetoothAdapter.LeScanCallback parameters in order to call notifyScannedDevice upon discovery of an iBeacon?
Thanks in advance!
Recent versions of the Android Beacon Library (dating back 18 months) already have integration with the Bluetooth Crash Resolver out-of-the box. There is no need to do any configuration as it is enabled automatically.
It is important to note, however, that the Bluetooth Crash Resolver is not a panacea for preventing crashes on Android 4.3 and 4.4. It works well on Nexus and other devices with close to stock Android. It works less well with some heavily modified Samsung ROMs.

Google Chrome App filesystem events, shell/finder integration

For a new desktop app project I'm researching if it's feasible to create a cross-platform implementation instead of native Windows and OS X apps. Chrome Apps seemed promising, but after browsing through the Chrome APIs there are some things I didn't see that I'll need in my app:
Notifications on changes to files in the local filesystem. (File System Events API on OS X, FileSystemWatcher on Windows.) At first I thought the syncFileSystem API might help with this, but it's apparently only for syncing with Google Drive, which is not what I need. I guess I could workaround this by scanning the directories I'm watching on a timer, but that won't perform well if there are a lot of directories and/or files.
Ability to add context menus in Windows shell and OS X Finder, as I would be able to with a Windows shell extension or OS X Finder plugin.
Ideally (although probably not a hard requirement) get the app into the Windows System Tray / OS X Menu Bar (NSStatusItem).
Can anyone confirm whether it's possible to access this functionality with a Chrome App? If not, can you recommend an alternative cross-platform tool for building an app with these features?
All of the listed features have bugs logged, but no real progress at the moment:
Watch: https://code.google.com/p/chromium/issues/detail?id=148873
File manager integration: https://code.google.com/p/chromium/issues/detail?id=130455
Sys tray: https://code.google.com/p/chromium/issues/detail?id=142450
The first of these to be made available will probably be file manager integration, which is being worked on now.
We'd love to improve watching but it is a significant task to support this on all operating systems and we don't have anyone working on it now.
Sys tray support is something we have no plans to release soon as we're not sure how we want to support this on ChromeOS.
I could not find anything close to the items you have mentioned. I did however find this product: node-webkit that likely would get you onto both your target platforms, use the same basic code-base (HTML5/CSS/JS) and allow some possible per-OS customization. There is even a 'watch' project under NPM that covers your first bullet point. Check node-webkit/wiki for notes on how to add C/C++ extensions to their node build (under using-node-modules.) Project seems active and appears to be backed by Intel (they re-built their XDK product on it to do cross platform.)

Resources