Applications installed through the DuoPlus cloud phone platform app in the automation category will have the accessibility permission enabled by default. If you have your own application that requires accessibility permission, you can achieve this through the API.
This tutorial takes the AutoJs6 app and Android 15 as an example. The process is as follows: obtain the accessibility service name on a cloud machine -> write the accessibility permission to other cloud machines via command.
After installing the app that requires accessibility permission, click on "Settings" on your phone.
Select "Accessibility"
Click on the app you installed, taking AutoJs6 as an example here.
Turn on the accessibility switch.
Click "Allow"
Click on "Automation" -> "API" -> "Generate KEY"
Copy your API KEY.
Using tools like POSTMAN, refer to the documentation: https://help.duoplus.cn/docs/execute-the-adb-command
Execute the command: settings get secure enabled_accessibility_services
The result you get is: org.autojs.autojs6/org.autojs.autojs.core.accessibility.AccessibilityServiceUsher
You can also request it using a CURL command:
curl -X POST https://openapi.duoplus.cn/api/v1/cloudPhone/command \
-H "Content-Type: application/json" \
-H "DuoPlus-API-Key: [replace with your API KEY]" \
-d '{"image_id": "[replace with your cloud phone ID]","command": "settings get secure enabled_accessibility_services"}'
Once you have obtained the accessibility service name, you can set the accessibility permission to be automatically enabled for all cloud phones via the API. Simply call the command for the specified cloud phone:
settings put secure enabled_accessibility_services [accessibility service name]
# For example: settings put secure enabled_accessibility_services org.autojs.autojs6/org.autojs.autojs.core.accessibility.AccessibilityServiceUsher
To enable multiple accessibility services, connect them with a “:”, for example: settings put secure enabled_accessibility_services [accessibility service 1]:[accessibility service 2]
If the return is successful, you are done.
You can also request it using a CURL command:
curl -X POST https://openapi.duoplus.cn/api/v1/cloudPhone/command \
-H "Content-Type: application/json" \
-H "DuoPlus-API-Key: [replace with your API KEY]" \
-d '{"image_id": "[replace with your cloud phone ID]","command": "settings put secure enabled_accessibility_services org.autojs.autojs6/org.autojs.autojs.core.accessibility.AccessibilityServiceUsher"}'
You can clear all accessibility services by executing the following command:
settings put secure enabled_accessibility_services ''
If you know the package name of the app, you can obtain the accessibility service name using the following command:
dumpsys package [package name] | grep -i accessibility
If you do not know the package name, you can get all package names installed on the cloud phone using the following command:
pm list packages -3