Is there any "adb command" or anything by which Android device (not emulator) display can get rotate i.e landscape to potrait and vice versa
Asked
Active
Viewed 8,025 times
1
-
1Try http://stackoverflow.com/a/14253321/603270 – shkschneider Apr 23 '14 at 12:43
-
@AndroidDev Sorry, but the question got edited 2 hours **after** I posted my comment (Maverick did not stated "not emulator" but Chris Stratton did)... Watch the history before going on flames. – shkschneider Aug 03 '15 at 08:03
2 Answers
0
I think this should work. To change the screen orientation to lanscape :
service call window 18 i32 1
and to change it to portrait :
service call window 18 i32 0
.

MathieuMaree
- 7,453
- 6
- 26
- 31
-
1@ Thnaks vieuMa for quick reply but .. it is displaying : Result: Parcel(00000000 '....') and screen orientation in not getting change :( – Maverick Apr 23 '14 at 12:50
-
@Maverick Sorry about that... I just found [another post](http://stackoverflow.com/questions/11184503/android-emulator-orientation-change-through-emulator-console-or-adb) that could maybe help you ? If not, do you really have to use ADB ? [Genymotion](http://www.genymotion.com/) is a really great emulator compared to standard emulator... – MathieuMaree Apr 23 '14 at 12:58
-
1I am testing on real device .. there i have to perform this action during one test run – Maverick Apr 23 '14 at 13:06
0
I've found the solution:
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1
1
at the end means that the device rotation will be set to "landscape".0
- "portrait".2
- "reversed portrait".3
- "other landscape".
Sources:

kcpr
- 1,055
- 1
- 12
- 28