Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use android adb shell to return one activity

Tags:

android

shell

adb

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?

like image 276
Vini.g.fer Avatar asked Feb 11 '23 15:02

Vini.g.fer


1 Answers

you might want to try:

adb shell input keyevent KEYCODE_BACK

cf. KEYCODE_BACK event

like image 158
ligi Avatar answered Feb 19 '23 09:02

ligi