When using AccessibilityService , after tested in android emulators, you should test it on the real device, but , sometimes, after deploying to the real device, the AccessibilityService onServiceConnected is not called anymore, what’s the problem?
2. How to solve it?
After trying and googling many times, I have found the solution: Just reboot your device after deploy. That is:
- use adb install xxx.apk to your device
- open the accessibility service and turn on your service’s switch
- reboot your device
- debug again
It should be ok now!
You can find detail android accessibility documents here: