OLD | NEW |
---|---|
1 # Checking out and building Chromium for Android | 1 # Checking out and building Chromium for Android |
2 | 2 |
3 There are instructions for other platforms linked from the | 3 There are instructions for other platforms linked from the |
4 [get the code](get_the_code.md) page. | 4 [get the code](get_the_code.md) page. |
5 | 5 |
6 ## Instructions for Google Employees | 6 ## Instructions for Google Employees |
7 | 7 |
8 Are you a Google employee? See | 8 Are you a Google employee? See |
9 [go/building-chrome](https://goto.google.com/building-chrome) instead. | 9 [go/building-chrome](https://goto.google.com/building-chrome) instead. |
10 | 10 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 `out/Release/apks/ContentShell.apk`. (Where `Release` is the name of your build | 217 `out/Release/apks/ContentShell.apk`. (Where `Release` is the name of your build |
218 directory.) | 218 directory.) |
219 | 219 |
220 If you use custom out dir instead of standard out/ dir, use | 220 If you use custom out dir instead of standard out/ dir, use |
221 CHROMIUM_OUT_DIR env. | 221 CHROMIUM_OUT_DIR env. |
222 | 222 |
223 ```shell | 223 ```shell |
224 export CHROMIUM_OUT_DIR=out_android | 224 export CHROMIUM_OUT_DIR=out_android |
225 ``` | 225 ``` |
226 | 226 |
227 ### Build WebView shell | |
228 | |
229 [Android WebView](https://developer.android.com/reference/android/webkit/WebView .html) | |
230 is a system framework component. Since Android KitKat, it is implemented using | |
231 Chromium code (based off the [content module](https://dev.chromium.org/developer s/content-module)). | |
232 It is possible to test modifications to WebView using a simple test shell. The | |
233 WebView shell is a view with a URL bar at the top (see [code](https://code.googl e.com/p/chromium/codesearch#chromium/src/android_webview/test/shell/src/org/chro mium/android_webview/test/AwTestContainerView.java)) | |
234 and is **independent** of the WebView **implementation in the Android system** ( | |
235 the WebView shell is essentially a standalone unbundled app). | |
236 As drawback, the shell runs in non-production rendering mode only. | |
237 | |
238 ```shell | |
239 ninja -C out/Release android_webview_apk | |
240 build/android/adb_install_apk.py out/Release/apks/AndroidWebView.apk | |
241 ``` | |
242 | |
243 If, instead, you want to build the complete Android WebView framework component and test the effect of your chromium changes in other Android app using the WebV iew, you should follow the [Android AOSP + chromium WebView instructions](https: //www.chromium.org/developers/how-tos/build-instructions-android-webview) | |
boliu
2017/03/23 20:32:41
can keep this link and the description?
just drop
Nate Fischer
2017/03/23 20:41:43
Let me know if this is an improvement.
| |
244 | |
245 ### Running | 227 ### Running |
246 | 228 |
247 Set [command line flags](https://www.chromium.org/developers/how-tos/run-chromiu m-with-flags) if necessary. | 229 Set [command line flags](https://www.chromium.org/developers/how-tos/run-chromiu m-with-flags) if necessary. |
248 | 230 |
249 For Content shell: | 231 For Content shell: |
250 | 232 |
251 ```shell | 233 ```shell |
252 build/android/adb_run_content_shell http://example.com | 234 build/android/adb_run_content_shell http://example.com |
253 ``` | 235 ``` |
254 | 236 |
255 For Chrome public: | 237 For Chrome public: |
256 | 238 |
257 ```shell | 239 ```shell |
258 build/android/adb_run_chrome_public http://example.com | 240 build/android/adb_run_chrome_public http://example.com |
259 ``` | 241 ``` |
260 | 242 |
261 For Android WebView shell: | |
262 | |
263 ```shell | |
264 build/android/adb_run_android_webview_shell http://example.com | |
265 ``` | |
266 | |
267 ### Logging and debugging | 243 ### Logging and debugging |
268 | 244 |
269 Logging is often the easiest way to understand code flow. In C++ you can print | 245 Logging is often the easiest way to understand code flow. In C++ you can print |
270 log statements using the LOG macro or printf(). In Java, you can print log | 246 log statements using the LOG macro or printf(). In Java, you can print log |
271 statements using [android.util.Log](https://developer.android.com/reference/andr oid/util/Log.html): | 247 statements using [android.util.Log](https://developer.android.com/reference/andr oid/util/Log.html): |
272 | 248 |
273 `Log.d("sometag", "Reticulating splines progress = " + progress);` | 249 `Log.d("sometag", "Reticulating splines progress = " + progress);` |
274 | 250 |
275 You can see these log statements using adb logcat: | 251 You can see these log statements using adb logcat: |
276 | 252 |
277 ```shell | 253 ```shell |
278 adb logcat...01-14 11:08:53.373 22693 23070 D sometag: Reticulating splines prog ress = 0.99 | 254 adb logcat...01-14 11:08:53.373 22693 23070 D sometag: Reticulating splines prog ress = 0.99 |
279 ``` | 255 ``` |
280 | 256 |
281 You can debug Java or C++ code. To debug C++ code, use one of the | 257 You can debug Java or C++ code. To debug C++ code, use one of the |
282 following commands: | 258 following commands: |
283 | 259 |
284 ```shell | 260 ```shell |
285 build/android/adb_gdb_content_shell | 261 build/android/adb_gdb_content_shell |
286 build/android/adb_gdb_chrome_public | 262 build/android/adb_gdb_chrome_public |
287 build/android/adb_gdb_android_webview_shell http://example.com | |
288 ``` | 263 ``` |
289 | 264 |
290 See [Debugging Chromium on Android](https://www.chromium.org/developers/how-tos/ debugging-on-android) | 265 See [Debugging Chromium on Android](https://www.chromium.org/developers/how-tos/ debugging-on-android) |
291 for more on debugging, including how to debug Java code. | 266 for more on debugging, including how to debug Java code. |
292 | 267 |
293 ### Testing | 268 ### Testing |
294 | 269 |
295 For information on running tests, see [android\_test\_instructions.md](https://c hromium.googlesource.com/chromium/src/+/master/docs/android_test_instructions.md ). | 270 For information on running tests, see [android\_test\_instructions.md](https://c hromium.googlesource.com/chromium/src/+/master/docs/android_test_instructions.md ). |
296 | 271 |
297 ### Faster Edit/Deploy (GN only) | 272 ### Faster Edit/Deploy (GN only) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 release of Chrome for Android (v25+) you can do the following steps. | 338 release of Chrome for Android (v25+) you can do the following steps. |
364 Note that in order to get your changes into the official release, you'll | 339 Note that in order to get your changes into the official release, you'll |
365 need to send your change for a codereview using the regular process for | 340 need to send your change for a codereview using the regular process for |
366 committing code to chromium. | 341 committing code to chromium. |
367 | 342 |
368 1. Open Chrome on your Android device and visit chrome://version | 343 1. Open Chrome on your Android device and visit chrome://version |
369 2. Copy down the id listed next to "Build ID:" | 344 2. Copy down the id listed next to "Build ID:" |
370 3. Go to | 345 3. Go to |
371 [http://storage.googleapis.com/chrome-browser-components/BUILD\_ID\_FROM\_ST EP\_2/index.html](http://storage.googleapis.com/chrome-browser-components/BUILD_ ID_FROM_STEP_2/index.html) | 346 [http://storage.googleapis.com/chrome-browser-components/BUILD\_ID\_FROM\_ST EP\_2/index.html](http://storage.googleapis.com/chrome-browser-components/BUILD_ ID_FROM_STEP_2/index.html) |
372 4. Download the listed files and follow the steps in the README. | 347 4. Download the listed files and follow the steps in the README. |
OLD | NEW |