Chromium Code Reviews| 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!_ | 7 _Currently we only support building Skia for Android on a Linux or Mac host!_ |
| 8 | 8 |
| 9 The following libraries/utilities are required in addition to those needed for a standard skia checkout: | 9 The following libraries/utilities are required in addition to those needed for a standard skia checkout: |
| 10 | 10 |
| 11 * Apache Ant | |
| 12 * The Android SDK: http://developer.android.com/sdk/ | 11 * The Android SDK: http://developer.android.com/sdk/ |
| 13 | 12 |
| 14 ~~~~ | |
| 15 $ sudo apt-get install ant git | |
| 16 ~~~~ | |
| 17 | |
| 18 Check out the source code | 13 Check out the source code |
| 19 ------------------------- | 14 ------------------------- |
| 20 | 15 |
| 21 Follow the instructions [here](../download) for downloading the Skia source. Mod ify .gclient to add the following line to | 16 Follow the instructions [here](../download) for downloading the Skia source. |
| 22 the bottom, and then run gclient sync again: | |
| 23 | |
| 24 target_os = ["android"] | |
| 25 | 17 |
| 26 Inside your Skia checkout, `platform_tools/android` contains the Android setup | 18 Inside your Skia checkout, `platform_tools/android` contains the Android setup |
| 27 scripts, Android specific dependencies, and the Android Sample App. | 19 scripts, Android specific dependencies, and the Android Sample App. |
| 28 | 20 |
| 29 Setup the Android SDK | 21 Setup the Android SDK |
| 30 --------------------- | 22 --------------------- |
| 31 | 23 |
| 32 To finish setting up the Android SDK you need to download use the SDK to | 24 To finish setting up the Android SDK you need to download use the SDK to |
| 33 download the appropriate API level. To do this simply go to the directory | 25 download the appropriate API level. To do this simply go to the directory |
| 34 where you installed the SDK and run the following commands | 26 where you installed the SDK and run the following commands |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 54 Custom Android Build Script | 46 Custom Android Build Script |
| 55 --------------------------- | 47 --------------------------- |
| 56 | 48 |
| 57 The android_ninja script is a wrapper for the ninja command (provided by | 49 The android_ninja script is a wrapper for the ninja command (provided by |
| 58 depot_tools) and is specifically designed to work with the Skia's build | 50 depot_tools) and is specifically designed to work with the Skia's build |
| 59 system. To use the script you need to call it from Skia's trunk directory with | 51 system. To use the script you need to call it from Skia's trunk directory with |
| 60 the -d option plus any of the options or arguments you would normally pass to | 52 the -d option plus any of the options or arguments you would normally pass to |
| 61 ninja (see descriptions of some of the other flags here). | 53 ninja (see descriptions of some of the other flags here). |
| 62 | 54 |
| 63 export ANDROID_SDK_ROOT=/path/to/android/sdk | 55 export ANDROID_SDK_ROOT=/path/to/android/sdk |
| 56 export ANDROID_HOME=/path/to/android/sdk | |
| 64 export PATH=$PATH:/path/to/depot_tools | 57 export PATH=$PATH:/path/to/depot_tools |
| 65 | 58 |
| 66 cd skia | 59 cd skia |
| 67 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_ nexus, etc... | 60 ./platform_tools/android/bin/android_ninja -d nexus_10 # or nexus_7, galaxy_ nexus, etc... |
| 68 | 61 |
| 69 The -d option enables the build system to target the build to a specific | 62 The -d option enables the build system to target the build to a specific |
| 70 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device | 63 architecture such as MIPS (generic), x86 (generic) and ARM (generic and device |
| 71 specific flavors for Nexus devices). This in turn allows Skia to take | 64 specific flavors for Nexus devices). This in turn allows Skia to take |
| 72 advantage of specific device optimizations (e.g. NEON instructions). | 65 advantage of specific device optimizations (e.g. NEON instructions). |
| 73 | 66 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 approach will also produce the noisiest results. | 119 approach will also produce the noisiest results. |
| 127 | 120 |
| 128 # <input> is file/dir on device | 121 # <input> is file/dir on device |
| 129 ./platform_tools/android/bin/android_run_skia --release nanobench --skps <in put> | 122 ./platform_tools/android/bin/android_run_skia --release nanobench --skps <in put> |
| 130 | 123 |
| 131 Build and run SampleApp | 124 Build and run SampleApp |
| 132 ----------------------- | 125 ----------------------- |
| 133 | 126 |
| 134 The SampleApp on Android provides a simple UI for viewing sample slides and gm i mages. | 127 The SampleApp on Android provides a simple UI for viewing sample slides and gm i mages. |
| 135 | 128 |
| 136 BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE | 129 BUILDTYPE=Debug ./platform_tools/android/bin/android_ninja -d $TARGET_DEVICE SampleApp_APK |
| 137 | 130 |
| 138 Then, install the app onto the device: | 131 Then, install the app onto the device: |
| 139 | 132 |
| 140 ./platform_tools/android/bin/android_install_app | 133 ./platform_tools/android/bin/android_install_app |
| 141 | 134 |
| 142 Finally to run the application you can either navigate to the Skia Samples | 135 Finally to run the application you can either navigate to the Skia Samples |
| 143 application using the application launcher on your device or from the command | 136 application using the application launcher on your device or from the command |
| 144 line. The command line option allows you to pass additional details to the | 137 line. The command line option allows you to pass additional details to the |
| 145 application (similiar to other operating system) that specify where to find | 138 application (similiar to other operating system) that specify where to find |
| 146 skp files and other resources. | 139 skp files and other resources. |
| 147 | 140 |
| 148 ./platform_tools/android/bin/android_launch_app --resourcePath /data/local/t mp/resources | 141 ./platform_tools/android/bin/android_launch_app --resourcePath /data/local/t mp/resources |
| 149 | 142 |
| 150 By default if no additional parameters are specified the app will use the defaul t | 143 By default if no additional parameters are specified the app will use the defaul t |
| 151 params... | 144 params... |
| 152 | 145 |
| 153 --resourcePath /data/local/tmp/skia_resoures | 146 --resourcePath /data/local/tmp/skia_resoures |
| 154 --pictureDir /data/local/tmp/skia_skp | 147 --pictureDir /data/local/tmp/skia_skp |
| 155 | 148 |
| 149 | |
| 150 Android Studio Support | |
| 151 ----------------------- | |
| 152 | |
| 153 You can also build and run SampleApp (and some other experimental apps) using An droid | |
| 154 Studio. To create the project either select "import project" from the quickstar t | |
| 155 screen or use File -> Open. In both cases you'll need to select ./platform_tool s/android/apps | |
| 156 as the root directory of your project. | |
| 157 | |
| 158 Finally to be able to build within Android studio it needs to know the path to | |
| 159 ninja so you will need to add a properties file and populate it with the path | |
| 160 to depot_tools. The syntax and location of that file is... | |
| 161 | |
| 162 # | |
| 163 # file location: ./platform_tools/android/apps/gradle.properties | |
| 164 # | |
| 165 depot_tools.dir=<path_to_depot_tools> | |
| 166 | |
| 167 That should be all the setup you need. You should now be able to build and depl oy | |
| 168 SampleApp on ARM and Intel devices. | |
|
scroggo
2015/07/08 18:39:35
Why do we specify particular chipsets?
djsollen
2015/07/08 18:49:47
because those are the only variants I added to And
| |
| 169 | |
| 170 | |
| 156 Build tools | 171 Build tools |
| 157 ----------- | 172 ----------- |
| 158 | 173 |
| 159 The Android platform does not support skdiff at this time. | 174 The Android platform does not support skdiff at this time. |
| 160 | 175 |
| 161 Clean up all generated files | 176 Clean up all generated files |
| 162 ---------------------------- | 177 ---------------------------- |
| 163 | 178 |
| 164 make clean | 179 make clean |
| 165 | 180 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 177 # include additional arguments in quotes (e.g. "dm --nopdf") | 192 # include additional arguments in quotes (e.g. "dm --nopdf") |
| 178 ./platform_tools/android/bin/android_gdb_native dm | 193 ./platform_tools/android/bin/android_gdb_native dm |
| 179 | 194 |
| 180 # SAMPLE APP | 195 # SAMPLE APP |
| 181 # make sure you've installed the app on the device first | 196 # make sure you've installed the app on the device first |
| 182 ./platform_tools/android/bin/android_gdb_app | 197 ./platform_tools/android/bin/android_gdb_app |
| 183 | 198 |
| 184 When the gdb client is ready, insert a breakpoint, and continue to let the | 199 When the gdb client is ready, insert a breakpoint, and continue to let the |
| 185 program resume execution. | 200 program resume execution. |
| 186 | 201 |
| OLD | NEW |