You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/beta builds.md
+62-33Lines changed: 62 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ Developers love writing React Native code but no one likes deploying React Nativ
4
4
5
5
All your headaches will disappear with this documentation and the amazing [Fastlane](https://fastlane.tools/) tool :)
6
6
7
+
7
8
## Before you start
8
9
9
10
You need a Mac. I'm sorry, but if you are a Windows user, you can stop reading right now.
@@ -14,25 +15,27 @@ Let's explain which tools we are using to distribute beta builds:
14
15
*[TestFlight](https://developer.apple.com/testflight/), part of App Store Connect, let you build your iOS app and invite internal or external users to test it
15
16
*[Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which does the same job as TestFlight for Android apps
16
17
18
+
17
19
## Installing Fastlane
18
20
19
21
First you need to install Fastlane on your Mac. Follow these steps:
20
22
21
23
1. Install the latest Xcode command line tools:
22
24
```
23
-
xcode-select --install
25
+
$ xcode-select --install
24
26
```
25
27
2. Install Ruby using [Homebrew](https://brew.sh/):
26
28
```
27
-
brew install ruby
29
+
$ brew install ruby
28
30
```
29
31
3. Install Fastlane with RubyGems:
30
32
```
31
-
sudo gem install fastlane -NV
33
+
$ sudo gem install fastlane -NV
32
34
```
33
35
34
36
You are now ready to set up Fastlane for iOS and Android :rocket:
35
37
38
+
36
39
## iOS
37
40
38
41
### Prerequisites
@@ -44,21 +47,35 @@ Before continuing make sure you have:
44
47
-[ ] An Apple ID with an admin user, with its username (email, for example `[email protected]`) and password
45
48
-[ ] Your app name, if not already created on the Developer Portal (for example `TCM React Native Boilerplate`). Fastlane can create applications in the Developer Portal and App Store Connect, so it's recommended to let Fastlane do the job for you.
46
49
-[ ] Use the right [.gitignore](ios/.gitignore) file inside the `ios` directory
50
+
-[ ] You also need to create an App Icon to use Fastlane or you will get an error on running `fastlane beta`. You can simply create one on using the website [AppIconMaker](http://appiconmaker.co/)
47
51
48
52
Open your Xcode project and modify some information:
49
53
50
-
-[ ] In the `General` tab, `Identity` section, change the `Bundle Identifier` to your identifier
54
+
-[ ] In the `General` tab, `Identity` section, change the `Bundle Identifier` to your identifier (useful for Fastlane)
51
55
-[ ] In the `General` tab, `Signing` section, disable `Automatically manage signing`
52
-
-[ ] In the `Build Settings` tab, under `Signing`, set `Don't Code Sign` as the `debug` codesigning identity and `iOS Distribution` as the `release` codesigning identity (for both `Debug`/`Release` and `Any iOS SDK`).
56
+
-[ ] In the `Build Settings` tab, `Signing` section and into `Code Signing Identity`, set `Don't Code Sign` for the `debug` line (including `Any iOS SDK` also) and set `iOS Distribution` for the `release` line (including `Any iOS SDK` also).
57
+
58
+
Like this:
59
+
60
+
| Code Signing Identity | < Multiple values > |
61
+
| ------------- | ------------- |
62
+
| Debug | Don't Code Sign |
63
+
| Any iOS SDK | Don't Code Sign |
64
+
| Release | iOS Distribution |
65
+
| Any iOS SDK | iOS Distribution |
66
+
53
67
54
68
### Setting up
55
69
56
70
First you need to set up Fastlane for your iOS project:
57
71
```
58
-
cd my-project/ios
59
-
fastlane init
72
+
$ cd my-project/ios
73
+
$ fastlane init
60
74
```
61
75
76
+
*Note: If you have an error on this step, please see the `issues` section.*
77
+
78
+
62
79
Fastlane will automatically detect your project and ask for any missing information.
63
80
64
81
The following questions will be asked:
@@ -73,18 +90,6 @@ The following questions will be asked:
73
90
* If you don't know, you didn't read the "Prerequisites" step :)
74
91
Our answer is `keep it secret`
75
92
76
-
At this step, you may have the following issue:
77
-
```
78
-
fastlane init failed
79
-
["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
You can either retry, or fallback to manual setup which will create a basic Fastfile
83
-
Would you like to fallback to a manual Fastfile? (y/n)
84
-
```
85
-
Answer `n`, and retry previous steps with a correct Apple ID and password.
86
-
Make sure you are connected to internet.
87
-
88
93
* If your account has multiple teams in the App Store Connect, you may have this question: `Multiple App Store Connect teams found, please enter the number of the team you want to use:`
89
94
* Select the right team
90
95
* If your account has multiple teams in the Developer Portal, you may have this question: `Multiple teams found on the Developer Portal, please enter the number of the team you want to use:`
@@ -97,16 +102,23 @@ Make sure you are connected to internet.
97
102
98
103
Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
99
104
100
-
Congrats! Fastlane has created some files.
105
+
**Congrats!** Fastlane has created some files.
106
+
101
107
If you are using Git, commit all generated files.
102
108
109
+
Before running any Fastlane command
110
+
103
111
Once the setup has finished you can see a new folder inside the `ios` folder:
104
112
```
105
113
- fastlane/
106
114
- Appfile
107
115
- Fastfile
108
116
```
109
117
118
+
It's not finish, you need to follow `Code Signing` part to setting up a provisioning profile.
119
+
120
+
For information:
121
+
110
122
`Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
111
123
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
112
124
@@ -118,6 +130,7 @@ This `lane` contains 3 actions:
118
130
* build your app
119
131
* upload to TestFlight
120
132
133
+
121
134
### Code signing
122
135
123
136
Signing your app assures users that it is from a known source and the app hasn’t been modified since it was last signed. Before your app can integrate app services, be installed on a device, or be submitted to the App Store, it must be signed with a certificate issued by Apple.
@@ -127,7 +140,7 @@ A full guide is available on the fastlane doc, describing the best approaches fo
127
140
Using `match` is probably [the best solution](https://codesigning.guide/).
128
141
Because we don't want to revoke our existing certificates, but still want an automated setup, we will use [cert and sigh](https://docs.fastlane.tools/codesigning/getting-started/#using-cert-and-sigh).
129
142
130
-
Add the following to your `Fastfile`, just after the `increment_build_number` function and before `build_app`:
143
+
Add the following lines to your `Fastfile`, just after the `increment_build_number` function and before `build_app` (Note that you will need to replace some information):
131
144
```
132
145
get_certificates( # Create or get certificate, and install it
133
146
output_path: "./builds" # Download certificate in the build folder (you don't need to create the folder)
@@ -149,7 +162,7 @@ Add the following to your `Fastfile`, just after the `increment_build_number` fu
149
162
150
163
Then, we need to configure the provisioning profile for the build step.
151
164
152
-
Add the following to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter:
165
+
Add the following lines to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter (Make sure you add a `,` after the `scheme` parameter):
153
166
```
154
167
clean: true,
155
168
export_method: "app-store",
@@ -161,7 +174,6 @@ Add the following to your `Fastfile`, inside the `build_app` function, just afte
161
174
build_path: "./builds",
162
175
output_directory: "./builds"
163
176
```
164
-
Make sure you have a `,` after the `scheme` parameter.
165
177
166
178
Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
167
179
:rocket: You are now ready to create your first beta build.
@@ -173,8 +185,8 @@ Creating a beta build and uploading it on TestFlight is now really easy.
173
185
Just type the following:
174
186
175
187
```
176
-
cd my-project/ios
177
-
fastlane beta
188
+
$ cd my-project/ios
189
+
$ fastlane beta
178
190
```
179
191
180
192
@@ -197,8 +209,8 @@ Before continuing make sure you have:
197
209
198
210
First you need to set up Fastlane for your android project:
199
211
```
200
-
cd my-project/android
201
-
fastlane init
212
+
$ cd my-project/android
213
+
$ fastlane init
202
214
```
203
215
204
216
Fastlane will automatically detect your project and ask for any missing information.
@@ -250,18 +262,35 @@ Creating a beta build and uploading it on Google Play is now really easy.
250
262
Just type the following:
251
263
252
264
```
253
-
cd my-project/android
254
-
fastlane beta
265
+
$ cd my-project/android
266
+
$ fastlane beta
255
267
```
256
268
257
269
If you have a `Permission denied` issue, please run:
258
270
```
259
-
chmod a+x /my-project/android/gradlew
271
+
$ chmod a+x /my-project/android/gradlew
260
272
```
261
273
274
+
262
275
## Troubleshooting
263
276
264
-
### Stuck at `bundle install` running `fastlane init`
277
+
### Stuck at `bundle install` or `bundle update` running `fastlane init`
278
+
279
+
If the `fastlane init` process is stuck when running `bundle install` or `bundle update` it may mean that `bundle` command is asking for root permissions.
280
+
You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes by running this command:
281
+
```
282
+
$ sudo chown <your-user> <files>
283
+
```
284
+
265
285
266
-
If the `fastlane init` process is stuck when running `bundle install` it may mean that `bundle install` is asking for root permissions.
267
-
You can stop the process and retry again with `sudo fastlane init`, however you will need to change back ownership of the generated files to your user when it finishes (`sudo chown <your-user> <files>`).
286
+
### Fastlane init failed
287
+
```
288
+
fastlane init failed
289
+
["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
0 commit comments