Android AccessibilityService onServiceConnected not called

1. Introduction

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:

  1. use adb install xxx.apk to your device
  2. open the accessibility service and turn on your service’s switch
  3. reboot your device
  4. debug again

It should be ok now!

You can find detail android accessibility documents here: