Vini.g.fer
Vini.g.fer

Reputation: 11919

Use android adb shell to return one activity

I have the following problem:

Our company manufactured a android device that have no return button (not physical and not at the bottom of the screen), so I can't return to the previous activity/screen. Now I need to test an App developed by a third-party that only save settings when I return to the previous screen.

Is there any way I can return to the previous screen or emulate a user clicking the return button?

I found this to return to HOME (Android main screen):

adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME

Also read about Activity Manager and Exerciser Monkey on these links:

http://developer.android.com/tools/help/adb.html#am

http://developer.android.com/tools/help/monkey.html

But wasn't able to solve my problem. Anybody knows how to accomplish this call using adb?

Upvotes: 5

Views: 12639

Answers (1)

ligi
ligi

Reputation: 39529

you might want to try:

adb shell input keyevent KEYCODE_BACK

cf. KEYCODE_BACK event

Upvotes: 12

Related Questions