OLD | NEW |
1 Android | 1 Android |
2 ======= | 2 ======= |
3 | 3 |
4 Prerequisites | 4 Prerequisites |
5 ------------- | 5 ------------- |
6 | 6 |
7 _Currently we only support building Skia for Android on a Linux or Mac host! In
addition, | 7 _Currently we only support building Skia for Android on a Linux or Mac host! In
addition, |
8 we only use the Mac build for local development. All shipping variants are comp
iled on | 8 we only use the Mac build for local development. All shipping variants are comp
iled on |
9 Linux for performance reasons._ | 9 Linux for performance reasons._ |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 many other Android add-ons or APIs as you want, but you only are required to | 42 many other Android add-ons or APIs as you want, but you only are required to |
43 have this one in order to complete the Skia build process. | 43 have this one in order to complete the Skia build process. |
44 | 44 |
45 Setup Environment for Android | 45 Setup Environment for Android |
46 ----------------------------- | 46 ----------------------------- |
47 | 47 |
48 The Android build needs to set up some specific variables needed by both GYP | 48 The Android build needs to set up some specific variables needed by both GYP |
49 and Make. We make this setup easy for developers by encapsulating all the | 49 and Make. We make this setup easy for developers by encapsulating all the |
50 details into a custom script that acts as a replacement for make. | 50 details into a custom script that acts as a replacement for make. |
51 | 51 |
| 52 Syncing the Source |
| 53 ----------------------------- |
| 54 We provide a utility to sync both our git repository as well as any third-party |
| 55 dependencies. Simply run the command below: |
| 56 |
| 57 <!--?prettify lang=sh?--> |
| 58 # Sync the source |
| 59 ./bin/sync |
| 60 |
52 Custom Android Build Script | 61 Custom Android Build Script |
53 --------------------------- | 62 --------------------------- |
54 | 63 |
55 The android_ninja script is a wrapper for the ninja command (provided by | 64 The android_ninja script is a wrapper for the ninja command (provided by |
56 depot_tools) and is specifically designed to work with the Skia's build | 65 depot_tools) and is specifically designed to work with the Skia's build |
57 system. To use the script you need to call it from Skia's trunk directory with | 66 system. To use the script you need to call it from Skia's trunk directory with |
58 the -d option plus any of the options or arguments you would normally pass to | 67 the -d option plus any of the options or arguments you would normally pass to |
59 ninja (see descriptions of some of the other flags here). | 68 ninja (see descriptions of some of the other flags here). |
60 | 69 |
61 export ANDROID_SDK_ROOT=/path/to/android/sdk | 70 export ANDROID_SDK_ROOT=/path/to/android/sdk |
62 export ANDROID_HOME=/path/to/android/sdk | 71 export ANDROID_HOME=/path/to/android/sdk |
63 export PATH=$PATH:/path/to/depot_tools | 72 export PATH=$PATH:/path/to/depot_tools |
64 | 73 |
65 cd skia | 74 cd skia |
66 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_
nexus, etc... | 75 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_
nexus, etc... |
67 | 76 |
68 The -d option enables the build system to target the build to a specific | 77 The -d option enables the build system to target the build to a specific |
69 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device | 78 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device |
70 specific flavors for Nexus devices). This in turn allows Skia to take | 79 specific flavors for Nexus devices). This in turn allows Skia to take |
71 advantage of specific device optimizations (e.g. NEON instructions). | 80 advantage of specific device optimizations (e.g. NEON instructions). |
72 | 81 |
73 Generate build file from GYP | |
74 ---------------------------- | |
75 | |
76 We use the open-source gyp tool to generate build files from our | |
77 multi-platform "gyp" files. While most other platforms enable you to | |
78 regenerate these files using `./gyp_skia` or `bin/sync-and-gyp` it is | |
79 recommended that you do NOT do this for Android. Instead you can rely | |
80 on it being run automatically by android_ninja. | |
81 | |
82 Faster rebuilds | 82 Faster rebuilds |
83 --------------- | 83 --------------- |
84 | 84 |
85 You can use ccache to improve the speed of rebuilding: | 85 You can use ccache to improve the speed of rebuilding: |
86 | 86 |
87 # You may want to add this export to your shell's .bash_profile or .profile | 87 # You may want to add this export to your shell's .bash_profile or .profile |
88 export ANDROID_MAKE_CCACHE=[ccache] | 88 export ANDROID_MAKE_CCACHE=[ccache] |
89 | 89 |
90 Build and run executables on the device | 90 Build and run executables on the device |
91 --------------------------------------- | 91 --------------------------------------- |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 # COMMAND LINE APPS | 198 # COMMAND LINE APPS |
199 # include additional arguments in quotes (e.g. "dm --nopdf") | 199 # include additional arguments in quotes (e.g. "dm --nopdf") |
200 ./platform_tools/android/bin/android_gdb_native dm | 200 ./platform_tools/android/bin/android_gdb_native dm |
201 | 201 |
202 # SAMPLE APP | 202 # SAMPLE APP |
203 # make sure you've installed the app on the device first | 203 # make sure you've installed the app on the device first |
204 ./platform_tools/android/bin/android_gdb_app [-d device_id] | 204 ./platform_tools/android/bin/android_gdb_app [-d device_id] |
205 | 205 |
206 When the gdb client is ready, insert a breakpoint, and continue to let the | 206 When the gdb client is ready, insert a breakpoint, and continue to let the |
207 program resume execution. | 207 program resume execution. |
OLD | NEW |