1
1
## Usage
2
2
3
+ ### Xcode
4
+
3
5
* Install [ prerequisite software] ( //github.com/firebase/firebase-ios-sdk#development )
4
- * Set up a workspace via CocoaPods
6
+ * Set up a workspace via CocoaPods (this opens Xcode):
5
7
```
6
8
$ cd Firestore/Example
7
9
$ pod update
10
12
* Select the Firestore_Tests_iOS scheme
11
13
* ⌘-u to build and run the unit tests
12
14
15
+ ### Command-line builds
16
+
17
+ You can also build from the command-line, though this requires a slightly
18
+ different setup:
19
+
20
+ ```
21
+ PLATFORM=iOS pod update --project-directory=Firestore/Example
22
+ scripts/build.sh Firestore iOS
23
+ ```
24
+
25
+ Note:
26
+ * `PLATFORM` here is specifying an environment variable that's active for the
27
+ `pod update` invocation.
28
+ * You can also use `macOS` or `tvOS` in place of `iOS` above.
29
+ * This will modify the Xcode project files; you'll need to revert these
30
+ changes to create a PR.
31
+
32
+ The [issue](https://github.com/CocoaPods/CocoaPods/issues/8729) that requires
33
+ this workaround is that Firestore's `Podfile` contains multiple platforms, and
34
+ ever since Xcode 10.2, CocoaPods generates Xcode projects that are break by
35
+ default when built by the `xcodebuild` command-line tool. There's a workaround
36
+ possible that involves disabling Xcode's default mechanism of finding implicit
37
+ dependencies, but this is something we'd have to disable Firebase-wide and
38
+ there hasn't been an appetite to do this.
39
+
40
+ ### Swift package manager
41
+
42
+ Firestore also supports building with Swift Package Manager. To build this way
43
+ use:
44
+
45
+ ```
46
+ scripts/build.sh Firestore iOS spm
47
+ ```
48
+
49
+ This is rarely necessary for primary development and is done automatically by CI.
50
+
13
51
### Improving the debugger experience
14
52
15
53
You can install a set of type formatters to improve the presentation of
@@ -21,6 +59,8 @@ command script import ~/path/to/firebase-ios-sdk/scripts/lldb/firestore.py
21
59
22
60
(substitute the location of your checkout of the firebase-ios-sdk.)
23
61
62
+ ## Testing
63
+
24
64
### Running Integration Tests
25
65
26
66
Prefer running the integration tests against the Firestore Emulator. This is
@@ -31,6 +71,9 @@ configure a Firestore-enabled project.
31
71
* In Xcode select the `Firestore_IntegrationTests_iOS` scheme (or macOS or tvOS).
32
72
* ⌘-u to build and run the integration tests.
33
73
74
+ The command-line build script runs integration tests by default and will start
75
+ and stop an emulator for you.
76
+
34
77
### Running Integration Tests - against production
35
78
36
79
Occasionally it's useful to run integration tests against a production account.
@@ -48,6 +91,8 @@ If you want to switch back to running integration tests against the emulator:
48
91
* Ensure that `GoogleServices-Info.plist` is in its default state (`git
49
92
checkout Firestore/Example/App/GoogleServices-Info.plist`).
50
93
94
+ ## Other tasks
95
+
51
96
### Building Protos
52
97
53
98
Typically you should not need to worrying about regenerating the C++ files from
0 commit comments