summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-09-22 15:46:43 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2018-09-22 15:46:43 -0400
commit571c94f277492978b5e51fbb88e943288f2e9505 (patch)
treeeaac03777527877045b37378f0d9cd554848d3cf
parent1810349744b6862c081b78f6c0aa5af4445c5827 (diff)
downloadmongo-571c94f277492978b5e51fbb88e943288f2e9505.tar.gz
SERVER-36019 Add documentation to use ADB wirelessly
(cherry picked from commit 6ea23db0a643fbd64e3f653108900915fc04f9e0)
-rw-r--r--buildscripts/mobile/README-Android.md30
-rw-r--r--buildscripts/mobile/adb_monitor.py6
2 files changed, 33 insertions, 3 deletions
diff --git a/buildscripts/mobile/README-Android.md b/buildscripts/mobile/README-Android.md
new file mode 100644
index 00000000000..ec04bdd7e8e
--- /dev/null
+++ b/buildscripts/mobile/README-Android.md
@@ -0,0 +1,30 @@
+# Profiling an Application on Android
+How to profile a test application for Android
+
+## Set up Your Local Environment
+1. Download ADB SDK
+1. Add the SDK platform-tools to your PATH
+ * export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools"
+
+## Run the ADB profiler
+The ADB profiler is a custom script which provides
+ * Battery statistics - battery.csv
+ * Memory statistics - memory.csv
+ * CPU statistics - cpu.json
+`python buildscripts/mobile/adb_monitor.py`
+
+## Run the ADB Profiler Wirelessly
+1. Ensure the local computer and Android device are on the same network
+1. Connect the Android device to the computer via USB cable
+1. Set the Android device's ADB listening port
+ * `adb devices`
+ * `adb tcpip 5555`
+1. Disconnect the USB cable
+1. Identify the Android's IP address
+ * Settings/About phone/Status
+ * `adb_ip=<ip_address>`, i.e., adb_ip=10.4.123.244
+1. Connect wirelessly to the Android device
+ * `adb connect $adb_ip`
+1. Ensure you can connect to the Android device
+ * `adb shell uptime`
+1. Run the ADB profiler as detailed above
diff --git a/buildscripts/mobile/adb_monitor.py b/buildscripts/mobile/adb_monitor.py
index 8ce1777ed99..0542b5e9428 100644
--- a/buildscripts/mobile/adb_monitor.py
+++ b/buildscripts/mobile/adb_monitor.py
@@ -330,9 +330,9 @@ def main(): #pylint: disable=too-many-statements
help="The destination file for memory stats (CSV format). [Default: %default].",
default="memory.csv")
- battery_options.add_option("--noMemory", dest="no_memory",
- help="Disable collection of memory samples.", action="store_true",
- default=False)
+ memory_options.add_option("--noMemory", dest="no_memory",
+ help="Disable collection of memory samples.", action="store_true",
+ default=False)
systrace_options.add_option(
"--cpuFile", dest="cpu_file",