OLD | NEW |
(Empty) | |
| 1 # Introduction |
| 2 |
| 3 This guide, which is meant to accompany the compilation guide at ChromotingBuild
Instructions, explains the process of viewing the logs and debugging the CRD And
roid client. I'll assume you've already built the APK as described in the afore
mentioned guide, that you're in the `src/` directory, and that your binary is at
`out/Release/apks/Chromoting.apk`. Additionally, you should have installed the
app on at least one (still) connected device. |
| 4 |
| 5 # Viewing logging output |
| 6 |
| 7 In order to access LogCat and view the app's logging output, we need to launch t
he Android Device Monitor. Run `third_party/android_tools/sdk/tools/monitor` an
d select the desired device under `Devices`. Using the app as normal will displ
ay log messages to the `LogCat` pane. |
| 8 |
| 9 # Attaching debuggers for Java code |
| 10 |
| 11 ## Eclipse |
| 12 1. Go to http://developer.android.com/sdk/index.html and click "Download the S
DK ADT Bundle for Linux" |
| 13 1. Configure eclipse |
| 14 1. Select General > Workspace from the tree on the left. |
| 15 1. Uncheck Refresh workspace on startup (if present) |
| 16 1. Uncheck Refresh using native hooks or polling (if present) |
| 17 1. Disable build before launching |
| 18 1. Select Run/Debug > Launching |
| 19 1. Uncheck Build (if required) before launching |
| 20 1. Create a project |
| 21 1. Select File > New > Project... from the main menu. |
| 22 1. Choose Java/Java Project |
| 23 1. Eclipse should have generated .project and perhaps a .classpath file in y
our <project root>/src/ directory. |
| 24 1. Replace/Add the .classpath file with the content from Below. Remember tha
t the path field should be the location of the chromium source relative to the c
urrent directory of your project. |
| 25 ``` |
| 26 <?xml version="1.0" encoding="UTF-8"?> |
| 27 <classpath> |
| 28 <classpathentry kind="src" path="net/test/android/javatests/src"/> |
| 29 <classpathentry kind="src" path="net/android/java/src"/> |
| 30 <classpathentry kind="src" path="net/android/javatests/src"/> |
| 31 <classpathentry kind="src" path="base/test/android/java/src"/> |
| 32 <classpathentry kind="src" path="base/test/android/javatests/src"/> |
| 33 <classpathentry kind="src" path="base/android/jni_generator/java/src"/> |
| 34 <classpathentry kind="src" path="base/android/java/src"/> |
| 35 <classpathentry kind="src" path="base/android/javatests/src"/> |
| 36 <classpathentry kind="src" path="components/cronet/android/java/src"/> |
| 37 <classpathentry kind="src" path="components/cronet/android/sample/src"/> |
| 38 <classpathentry kind="src" path="components/cronet/android/sample/javatests/src"
/> |
| 39 <classpathentry kind="src" path="components/autofill/core/browser/android/java/s
rc"/> |
| 40 <classpathentry kind="src" path="components/web_contents_delegate_android/androi
d/java/src"/> |
| 41 <classpathentry kind="src" path="components/dom_distiller/android/java/src"/> |
| 42 <classpathentry kind="src" path="components/navigation_interception/android/java
/src"/> |
| 43 <classpathentry kind="src" path="ui/android/java/src"/> |
| 44 <classpathentry kind="src" path="media/base/android/java/src"/> |
| 45 <classpathentry kind="src" path="chrome/test/android/unit_tests_apk/src"/> |
| 46 <classpathentry kind="src" path="chrome/test/android/javatests/src"/> |
| 47 <classpathentry kind="src" path="chrome/test/chromedriver/test/webview_shell/jav
a/src"/> |
| 48 <classpathentry kind="src" path="chrome/common/extensions/docs/examples/extensio
ns/irc/servlet/src"/> |
| 49 <classpathentry kind="src" path="chrome/android/java/src"/> |
| 50 <classpathentry kind="src" path="chrome/android/uiautomator_tests/src"/> |
| 51 <classpathentry kind="src" path="chrome/android/shell/java/src"/> |
| 52 <classpathentry kind="src" path="chrome/android/shell/javatests/src"/> |
| 53 <classpathentry kind="src" path="chrome/android/javatests/src"/> |
| 54 <classpathentry kind="src" path="sync/test/android/javatests/src"/> |
| 55 <classpathentry kind="src" path="sync/android/java/src"/> |
| 56 <classpathentry kind="src" path="sync/android/javatests/src"/> |
| 57 <classpathentry kind="src" path="mojo/public/java/src"/> |
| 58 <classpathentry kind="src" path="mojo/android/system/src"/> |
| 59 <classpathentry kind="src" path="mojo/android/javatests/src"/> |
| 60 <classpathentry kind="src" path="mojo/shell/android/apk/src"/> |
| 61 <classpathentry kind="src" path="mojo/services/native_viewport/android/src"/> |
| 62 <classpathentry kind="src" path="testing/android/java/src"/> |
| 63 <classpathentry kind="src" path="printing/android/java/src"/> |
| 64 <classpathentry kind="src" path="tools/binary_size/java/src"/> |
| 65 <classpathentry kind="src" path="tools/android/memconsumer/java/src"/> |
| 66 <classpathentry kind="src" path="tools/android/findbugs_plugin/test/java/src"/> |
| 67 <classpathentry kind="src" path="tools/android/findbugs_plugin/src"/> |
| 68 <classpathentry kind="src" path="remoting/android/java/src"/> |
| 69 <classpathentry kind="src" path="remoting/android/apk/src"/> |
| 70 <classpathentry kind="src" path="remoting/android/javatests/src"/> |
| 71 <classpathentry kind="src" path="third_party/WebKit/Source/devtools/scripts/jsdo
c-validator/src"/> |
| 72 <classpathentry kind="src" path="third_party/WebKit/Source/devtools/scripts/comp
iler-runner/src"/> |
| 73 <classpathentry kind="src" path="third_party/webrtc/voice_engine/test/android/an
droid_test/src"/> |
| 74 <classpathentry kind="src" path="third_party/webrtc/modules/video_capture/androi
d/java/src"/> |
| 75 <classpathentry kind="src" path="third_party/webrtc/modules/video_render/android
/java/src"/> |
| 76 <classpathentry kind="src" path="third_party/webrtc/modules/audio_device/test/an
droid/audio_device_android_test/src"/> |
| 77 <classpathentry kind="src" path="third_party/webrtc/modules/audio_device/android
/java/src"/> |
| 78 <classpathentry kind="src" path="third_party/webrtc/examples/android/media_demo/
src"/> |
| 79 <classpathentry kind="src" path="third_party/webrtc/examples/android/opensl_loop
back/src"/> |
| 80 <classpathentry kind="src" path="third_party/webrtc/video_engine/test/auto_test/
android/src"/> |
| 81 <classpathentry kind="src" path="third_party/libjingle/source/talk/app/webrtc/ja
va/src"/> |
| 82 <classpathentry kind="src" path="third_party/libjingle/source/talk/app/webrtc/ja
vatests/src"/> |
| 83 <classpathentry kind="src" path="third_party/libjingle/source/talk/examples/andr
oid/src"/> |
| 84 <classpathentry kind="src" path="android_webview/java/src"/> |
| 85 <classpathentry kind="src" path="android_webview/java/generated_src"/> |
| 86 <classpathentry kind="src" path="android_webview/test/shell/src"/> |
| 87 <classpathentry kind="src" path="android_webview/unittestjava/src"/> |
| 88 <classpathentry kind="src" path="android_webview/javatests/src"/> |
| 89 <classpathentry kind="src" path="content/public/test/android/javatests/src"/> |
| 90 <classpathentry kind="src" path="content/public/android/java/src"/> |
| 91 <classpathentry kind="src" path="content/public/android/javatests/src"/> |
| 92 <classpathentry kind="src" path="content/shell/android/browsertests_apk/src"/> |
| 93 <classpathentry kind="src" path="content/shell/android/java/src"/> |
| 94 <classpathentry kind="src" path="content/shell/android/shell_apk/src"/> |
| 95 <classpathentry kind="src" path="content/shell/android/javatests/src"/> |
| 96 <classpathentry kind="src" path="content/shell/android/linker_test_apk/src"/> |
| 97 <classpathentry kind="lib" path="third_party/android_tools/sdk/platforms/android
-19/data/layoutlib.jar"/> |
| 98 <classpathentry kind="lib" path="third_party/android_tools/sdk/platforms/android
-19/android.jar"/> |
| 99 <classpathentry kind="output" path="out/bin"/> |
| 100 </classpath> |
| 101 ``` |
| 102 1. Obtain the debug port |
| 103 1. Go to Window > Open Perspective > DDMS |
| 104 1. In order for the app org.chromium.chromoting to show up, you must build D
ebug instead of Retail |
| 105 1. Note down the port number, should be 8600 or 8700 |
| 106 1. Setup a debug configuration |
| 107 1. Go to Window > Open Perspective > Debug |
| 108 1. Run > Debug > Configurations |
| 109 1. Select "Remote Java Application" and click "New" |
| 110 1. Put Host: localhost and Port: <the port from DDMS> |
| 111 1. Hit Debug |
| 112 1. Configure source path |
| 113 1. Right click on the Chromoting [Application](Remoting.md) and select Edit
source Lookup Path |
| 114 1. Click "Add" and select File System Directory |
| 115 1. Select the location of your chromium checkout, e.g. <project root>/src/re
moting/android |
| 116 1. Debugging |
| 117 1. To add a breakpoint, simply open the source file and hit Ctrl+Shift+B to
toggle the breakpoint. Happy hacking. |
| 118 ## Command line debugger |
| 119 |
| 120 With the Android Device Monitor open, look under `Devices`, expand the entry for
the device on which you want to debug, and select the entry for `org.chromium.c
hromoting` (it must already be running). This forwards the JVM debugging connec
tion to your local port 8700. In your shell, do `$ jdb -attach localhost:8700`. |
| 121 |
| 122 # Attaching GDB to debug native code |
| 123 |
| 124 The Chromium build system provides a convenience wrapper script that can be used
to easily launch GDB. Run `$ build/android/adb_gdb --package-name=org.chromium
.chromoting --activity=.Chromoting --start`. Note that if you have multiple dev
ices connected, you must export `ANDROID_SERIAL` to select one; set it to the se
rial number of the desired device as output by `$ adb devices`. |
OLD | NEW |