Command line client for SUTAgent should have commands to get device info

RESOLVED FIXED

Status

Testing
Mozbase
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: wlach, Assigned: wlach)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 624859 [details] [diff] [review]
Patch to add commands to get device info from command line

It would be nice to have the ability to get device information using the command line SUT client. Both device information like screen dimensions, as well as the process list.

Here's a patch which does that. Example usage:

(mozbase)wlach@eideticker:~/src/mozbase$ sut info power
reconnecting socket
Power status:
 AC power ONLINE
 Battery charge NO BATTERY FULL
 Remaining charge: 100%
 Battery Temperature: 38.0 (c)

(mozbase)wlach@eideticker:~/src/mozbase$ sut info
reconnecting socket
DISK:
ID: a0:0b:ba:8f:da:43
MEMORY: PA:237469696
OS: IMM76I
POWER: Power status:
POWER:  AC power ONLINE
POWER:  Battery charge NO BATTERY FULL
POWER:  Remaining charge: 100%
POWER:  Battery Temperature: 38.0 (c)
SCREEN: X:1196 Y:720
SYSTIME: 2012/05/17 04:18:02:549
UPTIME: 0 days 4 hours 59 minutes 55 seconds 295 ms

(mozbase)wlach@eideticker:~/src/mozbase$ sut ps
reconnecting socket
339 com.android.phasebeam 10041
370 com.google.process.gapps 10010
352 com.google.android.inputmethod.latin 10028
388 com.android.phone 1001
192 system 1000
908 com.google.android.gm 10019
939 com.google.android.gsf.login 10010
1345 com.google.android.apps.maps 10032
3812 org.mozilla.fennec_aurora 10060
1485 org.mozilla.f3nn3c_aurora.PasswordsProvider 10060
413 com.android.launcher 10029
1707 com.noshufou.android.su 10058
1215 android.process.acore 10000
1114 com.facebook.katana 10065
1633 android.process.media 10013
1894 com.android.settings 1000
1530 com.mozilla.SUTAgentAndroid 10059
1401 com.littlefluffytoys.cyclehire 10068
1181 com.google.android.apps.maps:LocationFriendService 10032
928 com.google.android.apps.maps:FriendService 10032
1379 com.google.android.apps.maps:NetworkLocationService 10032
728 com.google.android.apps.genie.geniewidget 10018
267 com.android.systemui 1000
400 com.android.nfc 1027
Attachment #624859 - Flags: review?(jmaher)
Comment on attachment 624859 [details] [diff] [review]
Patch to add commands to get device info from command line

Review of attachment 624859 [details] [diff] [review]:
-----------------------------------------------------------------

just one question for you.

::: mozdevice/mozdevice/sutcli.py
@@ +129,5 @@
> +            directive=args[0]
> +        info = self.dm.getInfo(directive=directive)
> +        for (infokey, infoitem) in sorted(info.iteritems()):
> +            if infokey == "process":
> +                pass # skip process list: get that through ps

not sure why we want to do this, is there something wrong with it in both places?
Attachment #624859 - Flags: review?(jmaher) → review+
(In reply to Joel Maher (:jmaher) from comment #1)
> Comment on attachment 624859 [details] [diff] [review]
> Patch to add commands to get device info from command line
> 
> Review of attachment 624859 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> just one question for you.
> 
> ::: mozdevice/mozdevice/sutcli.py
> @@ +129,5 @@
> > +            directive=args[0]
> > +        info = self.dm.getInfo(directive=directive)
> > +        for (infokey, infoitem) in sorted(info.iteritems()):
> > +            if infokey == "process":
> > +                pass # skip process list: get that through ps
> 
> not sure why we want to do this, is there something wrong with it in both
> places?

Just that the process list, in my experience, is a bunch of extra information that I'm not usually interested in when running info. The process list is so long that it overwhelms the other information you get from running "info". If you do want the process list, you can get it easily just by running "sut ps"
Pushed: https://github.com/mozilla/mozbase/commit/e45c3dc996398a7682a2d33d580daeb68c010e5d
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.