1 Instructions to Run (and modify) app-launcher script
2 ----------------------------------------------------
4 Introduction: app-launcher is a script that launches apps many times,
5 measures various system metrics, computes basic stats for the metrics
6 and reports that stats.
9 1) Make sure the device is seen via 'adb devices' and authorize adb via the
11 2) Clear the setup wizard.
12 3) Login to an android user test account.
13 4) Clear the first time user dialogs on supported apps for your device (see
15 5) Enable wifi and connect to a network (ex. GoogleGuest).
17 Launching app-launcher :
18 app-launcher -a|-b|-u [-c|-v|-s <serial number>] num-iterations
21 -c:pagecached. Don't drop pagecache before each launch (not default)
23 -u:user experience, no change to cpu/gpu frequencies or governors'
24 -v:Optional, Verbose mode, prints stats on a lot of metrics.
25 -s <serial number>:Optional, specify serial number if multiple devices are
27 num-iterations : Must be >= 100 to get statistically valid data.
29 Note, under -a|-b, we lock the CPU and GPU frequencies.
32 On phone, these 4 apps are launched
38 On Fugu (Google TV), these 3 apps are launched
43 To add new apps, launch app manually and grep for package name +
44 activity name in logcat and add these to the launch_phone_apps()
47 Adding support for new Devices to app-launcher :
48 There are a few bits of code needed to do this.
49 1) Add a new cpufreq_<device> routine to fix the CPU/GPU frequencies
51 2) Add logic that checks the $model obtained and check against your device.
52 (a) Then add code to call your cpufreq_<device> routine there
53 (b) (Optional) Add code to get the /system block device pathname. This is
54 only needed if you wan to get storage block device (/system) data.
56 Adding new Metrics to app-launcher :
57 You can modify the way simpleperf is used in the script to collect
58 different metrics, but that will require a change to getstats() to
59 parse the output as necessary. Adding new storage stats or other stats
60 collected from /proc (or /sys) is definitely possible, but code needs
61 to be written for that - modeled after the disk_stats_before/after
66 Here are the commands to launch/stop the various Apps of interest. The
67 way to find the package and activity for the app of interest is to
68 launch the app and then grep for it in logcat to find the
69 package+activity and use that in am start.
72 adb shell 'simpleperf stat -a am start -W -n com.android.chrome/com.google.android.apps.chrome.Main'
73 adb shell 'am force-stop com.android.chrome'
76 adb shell 'simpleperf stat -a am start -W -n com.google.android.GoogleCamera/com.android.camera.CameraActivity'
77 adb shell 'am force-stop com.google.android.GoogleCamera'
80 adb shell 'simpleperf stat -a am start -W -n com.google.android.apps.maps/com.google.android.maps.MapsActivity'
81 adb shell 'am force-stop com.google.android.apps.maps'
84 adb shell 'am start -W -n com.google.android.youtube/com.google.android.apps.youtube.app.WatchWhileActivity'
85 adb shell 'am force-stop com.google.android.youtube'