blob: 63b11367899a74ed643118db55ffde4ae58f0c91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# Developing Chrome for iOS with the Xcode IDE
This document contains notes used during a presentation about how to use Xcode
to develop Chrome for iOS.
## Background
### .xcworkspace and .xcodeproj
* Open all.xcworkspace only.
* Generated from BUILD.gn files.
* Don't make changes to it as it is a "fake" representation of the project
- changes will not be committed
- changes will be overwritten without warning
* Modify BUILD files instead
* Added BUILD.gn files/`source_sets` need to be referenced from other ones as
a `dep` in order for it to be shown in xcode.
Warning: *do not open the `.xcodeproj` as this file does not configure the
"Legacy Build System". If you do open this file, many things won't work
properly (clicking on an error won't open the corresponding file, ...).*
### Adding new files
* Create new files with `tools/boilerplate.py`
* Add files to BUILD.gn `mate ios/chrome/...BUILD.gn`
* Add new source_set target as a dep of another target
* Execute `gclient runhooks` or `gclient sync`
### Simulators
* Simulators build for Mac architecture, not emulators. Fast, generally good
for most development
* To run on device, need provisioning profiles and certificate
## Xcode
* Project location is `src/out/build/`, open `all.workspace`
* Choose "Automatically generate targets" after a `gclient sync`
* Start typing while dropdowns are presented to filter the displayed items
### Targets
* `chrome' is the main application target
* `ios_web_shell` and `ios_web_view_shell` test lower level of application
### Tests
* Unittests/Inttests
- Add flags to specify tests to run (Option-Click on unittest target name,
select Run from left panel, add to "Arguments Passed on Launch")
- `gtest_filter=TestClass.*`
- `gtest_repeat=20`
- Full list of options available by sending an unknown option
* EarlGrey
- EG1 deprecated
- EG2 are current UI tests
- A separate "test" process communicates with "the app".
- EDO is term for "distant object" on "the other side".
- egtest files can run under both EG1 and EG2 with correct setup in
BUILD.gn because the layer of helpers encapsulate the necessary
differences.
|