Can an installed application be completely controlled via adb?

For example: Consider I need to to export my Contacts to SD Card. So here there are basically 5 Steps involved

1)Open Contacts application

2)Press Menu Key

3)Select Import/Export option

4)Select Export to SD card

5)Confirm Export

Can any/all of them be performed via adb?

This can be useful when you have an unrooted phone with a bricked display and all access you have is via adb.

  • Why didn't you have all your contacts sync through Gmail or Hotmail?
    – t0mm13b
    Jul 11 '12 at 18:11
  • I prefer not giving up my contacts to google or any 3rd party for that matter. I tried Kies but it won't detect my Galaxy S (The bricked phone) while it works perfectly fine for Galaxy Mini.
    – kn330
    Jul 11 '12 at 18:23
  • Why not go back to your carrier's shop and get them to do it for you - they'd have the means to do this kind of thing for customers who are clumsy?
    – t0mm13b
    Jul 11 '12 at 18:36
  • 1
    you can generate key events with adb. technically it should be possible to launch a thoroughly crafted series of key events to an app.
    – ce4
    Jul 12 '12 at 6:09
  • Thanks a lot ce4. It worked! Exported my contacts to SD card.
    – kn330
    Jul 12 '12 at 14:36

Yes and no. You can issue intents with adb but that's it. So the steps you described can't be achieved with adb.

Edit: ce4 showed a blog post which mentions the input binary which is able to simulate key events.

adb shell input keyevent <keycode>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.