OLD | NEW |
1 iOS | 1 iOS |
2 === | 2 === |
3 | 3 |
4 The following has been tested on MacOS Yosemite with Xcode version 6.3. | 4 The following has been tested on MacOS Yosemite with Xcode version 6.3. |
5 | 5 |
6 Quickstart | 6 Quickstart |
7 ---------- | 7 ---------- |
8 | 8 |
9 1. Install [XCode](http://developer.apple.com/xcode/). | 9 First, install [XCode](https://developer.apple.com/xcode/). |
10 | 10 |
11 2. Install depot tools. | 11 <!--?prettify lang=sh?--> |
12 | 12 |
13 <!--?prettify lang=sh?--> | 13 # Install depot tools. |
| 14 git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' |
| 15 export PATH="${PWD}/depot_tools:${PATH}" |
14 | 16 |
15 git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.
git' | 17 # Get Skia. |
16 export PATH="${PWD}/depot_tools:${PATH}" | 18 git clone 'https://skia.googlesource.com/skia' |
| 19 cd skia |
17 | 20 |
18 3. Get Skia. | 21 # Create the project files. |
19 | 22 GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" python b
in/sync-and-gyp |
20 <!--?prettify lang=sh?--> | 23 # Build and run SampleApp. |
21 | 24 xed out/gyp/SampleApp.xcodeproj # opens the SampleApp project in Xcode |
22 git clone 'https://skia.googlesource.com/skia' | |
23 cd skia | |
24 | |
25 4. Create the project files. | |
26 | |
27 <!--?prettify lang=sh?--> | |
28 | |
29 GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" ./gy
p_skia | |
30 | |
31 5. Build and run SampleApp. | |
32 | |
33 <!--?prettify lang=sh?--> | |
34 | |
35 xed out/gyp/SampleApp.xcodeproj # opens the SampleApp project in Xcode | |
36 | 25 |
37 Prerequisites | 26 Prerequisites |
38 ------------- | 27 ------------- |
39 | 28 |
40 Make sure the following have been installed: | 29 Make sure the following have been installed: |
41 | 30 |
42 * XCode (Apple's development environment): required | 31 * XCode (Apple's development environment): required |
43 * publicly available at http://developer.apple.com/xcode/ | 32 * publicly available at http://developer.apple.com/xcode/ |
44 * add the optional Unix Tools to the install so you get the make command lin
e tool. | 33 * add the optional Unix Tools to the install so you get the make command lin
e tool. |
45 * Chromium depot_tools: required to download the source and dependencies | 34 * Chromium depot_tools: required to download the source and dependencies |
(...skipping 15 matching lines...) Expand all Loading... |
61 Before building, make sure that gyp knows to create an XCode project or ninja | 50 Before building, make sure that gyp knows to create an XCode project or ninja |
62 build files. If you leave GYP_GENERATORS undefined it will assume the | 51 build files. If you leave GYP_GENERATORS undefined it will assume the |
63 following default: | 52 following default: |
64 | 53 |
65 GYP_GENERATORS="ninja,xcode" | 54 GYP_GENERATORS="ninja,xcode" |
66 | 55 |
67 Or you can set it to `xcode` alone, if you like. | 56 Or you can set it to `xcode` alone, if you like. |
68 | 57 |
69 You can then generate the Xcode projects by running: | 58 You can then generate the Xcode projects by running: |
70 | 59 |
71 GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" ./gyp_sk
ia | 60 GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" python b
in/sync-and-gyp |
72 | 61 |
73 Alternatively, you can do: | 62 Alternatively, you can do: |
74 | 63 |
75 export GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" | 64 export GYP_DEFINES="skia_os='ios' skia_arch_type='arm' armv7=1 arm_neon=0" |
76 ./gyp_skia | 65 python bin/sync-and-gyp |
77 | 66 |
78 Build and run tests | 67 Build and run tests |
79 ------------------- | 68 ------------------- |
80 | 69 |
81 The 'dm' test program is wrapped in an app called iOSShell. The project for iOSS
hell is at out/gyp/iOSShell.xcodeproj. | 70 The 'dm' test program is wrapped in an app called iOSShell. The project for iOSS
hell is at out/gyp/iOSShell.xcodeproj. |
82 Running this app with the flag '--dm' will run unit tests and golden master imag
es. Other arguments to the standard 'dm' | 71 Running this app with the flag '--dm' will run unit tests and golden master imag
es. Other arguments to the standard 'dm' |
83 test program can also be passed in. | 72 test program can also be passed in. |
84 | 73 |
85 To launch the iOS app on a device from the command line you can use a tool such
as [ios-deploy](https://github.com/phonegap/ios-deploy): | 74 To launch the iOS app on a device from the command line you can use a tool such
as [ios-deploy](https://github.com/phonegap/ios-deploy): |
86 | 75 |
(...skipping 13 matching lines...) Expand all Loading... |
100 The 'nanobench' test program is also wrapped in iOSShell.app. Passing in the fla
g '--nanobench' will run these tests. | 89 The 'nanobench' test program is also wrapped in iOSShell.app. Passing in the fla
g '--nanobench' will run these tests. |
101 | 90 |
102 Here's an example of running nanobench from the command line. We will build with
the "Release" configuration, since we are running performance tests. | 91 Here's an example of running nanobench from the command line. We will build with
the "Release" configuration, since we are running performance tests. |
103 | 92 |
104 xcodebuild --project out/gyp/iOSShell.xcodeproj -configuration Release | 93 xcodebuild --project out/gyp/iOSShell.xcodeproj -configuration Release |
105 ios-deploy --bundle xcodebuild/Release-iphoneos/iOSShell.app -I -d --args "-
-nanobench <nanobench_args>" | 94 ios-deploy --bundle xcodebuild/Release-iphoneos/iOSShell.app -I -d --args "-
-nanobench <nanobench_args>" |
106 | 95 |
107 Build and run SampleApp in the XCode IDE | 96 Build and run SampleApp in the XCode IDE |
108 ---------------------------------------- | 97 ---------------------------------------- |
109 | 98 |
110 * Run gyp_skia as described above. | 99 * Run `sync-and-gyp` as described above. |
111 * In the Finder, navigate to $SKIA_INSTALLDIR/trunk/out/gyp | 100 * In the Finder, navigate to $SKIA_INSTALLDIR/trunk/out/gyp |
112 * Double-click SampleApp.xcodeproj ; this will launch XCode and open the Sampl
eApp project | 101 * Double-click SampleApp.xcodeproj ; this will launch XCode and open the Sampl
eApp project |
113 * Make sure the SampleApp target is selected, and choose an iOS device to run
on | 102 * Make sure the SampleApp target is selected, and choose an iOS device to run
on |
114 * Click the “Build and Run” button in the top toolbar | 103 * Click the “Build and Run” button in the top toolbar |
115 * Once the build is complete, launching the app will display a window with lot
s of shaded text examples. On the upper left there is a drop down | 104 * Once the build is complete, launching the app will display a window with lot
s of shaded text examples. On the upper left there is a drop down |
116 menu that allows you to cycle through different test pages. On the upper right t
here is a dialog with a set of options, including different | 105 menu that allows you to cycle through different test pages. On the upper right t
here is a dialog with a set of options, including different |
117 rendering methods for each test page. | 106 rendering methods for each test page. |
118 | 107 |
119 Provisioning | 108 Provisioning |
120 ------------ | 109 ------------ |
121 | 110 |
122 To run the Skia apps on an iOS device rather than using the simulator, you will
need a developer account and a provisioning profile. See | 111 To run the Skia apps on an iOS device rather than using the simulator, you will
need a developer account and a provisioning profile. See |
123 [Launching Your App on Devices](https://developer.apple.com/library/ios/document
ation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYo
urApponDevices.html) for more information. | 112 [Launching Your App on Devices](https://developer.apple.com/library/ios/document
ation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYo
urApponDevices.html) for more information. |
124 | 113 |
125 Managing App Data | 114 Managing App Data |
126 ----------------- | 115 ----------------- |
127 By default, the iOS apps will look for resource files in the Documents/resources
folder of the app and write any output files to Documents/. To upload resources | 116 By default, the iOS apps will look for resource files in the Documents/resources
folder of the app and write any output files to Documents/. To upload resources |
128 so that the app can read them you can use a tool such as [ios-deploy](https://gi
thub.com/phonegap/ios-deploy). For example: | 117 so that the app can read them you can use a tool such as [ios-deploy](https://gi
thub.com/phonegap/ios-deploy). For example: |
129 | 118 |
130 ios-deploy --bundle_id 'com.google.SkiaSampleApp' --upload resources/baby_tu
x.png --to Documents/resources/baby_tux.png | 119 ios-deploy --bundle_id 'com.google.SkiaSampleApp' --upload resources/baby_tu
x.png --to Documents/resources/baby_tux.png |
131 | 120 |
132 You can use the same tool to download log files and golden master (GM) images: | 121 You can use the same tool to download log files and golden master (GM) images: |
133 | 122 |
134 ios-deploy --bundle_id 'com.google.iOSShell' --download=/Documents --to ./my
_download_location | 123 ios-deploy --bundle_id 'com.google.iOSShell' --download=/Documents --to ./my
_download_location |
135 | 124 |
136 Alternatively, you can put resources and other files in the bundle of the applic
ation. In this case, you'll need to run the app with the option '--resourcePath
.' | 125 Alternatively, you can put resources and other files in the bundle of the applic
ation. In this case, you'll need to run the app with the option '--resourcePath
.' |
OLD | NEW |