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
+60-33Lines changed: 60 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,7 +102,8 @@ 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
103
109
Once the setup has finished you can see a new folder inside the `ios` folder:
@@ -107,6 +113,10 @@ Once the setup has finished you can see a new folder inside the `ios` folder:
107
113
- Fastfile
108
114
```
109
115
116
+
It's not finish, you need to follow `Code Signing` part to setting up a provisioning profile.
117
+
118
+
For information:
119
+
110
120
`Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
111
121
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
112
122
@@ -118,6 +128,7 @@ This `lane` contains 3 actions:
118
128
* build your app
119
129
* upload to TestFlight
120
130
131
+
121
132
### Code signing
122
133
123
134
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 +138,7 @@ A full guide is available on the fastlane doc, describing the best approaches fo
127
138
Using `match` is probably [the best solution](https://codesigning.guide/).
128
139
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
140
130
-
Add the following to your `Fastfile`, just after the `increment_build_number` function and before `build_app`:
141
+
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
142
```
132
143
get_certificates( # Create or get certificate, and install it
133
144
output_path: "./builds" # Download certificate in the build folder (you don't need to create the folder)
@@ -149,7 +160,7 @@ Add the following to your `Fastfile`, just after the `increment_build_number` fu
149
160
150
161
Then, we need to configure the provisioning profile for the build step.
151
162
152
-
Add the following to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter:
163
+
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
164
```
154
165
clean: true,
155
166
export_method: "app-store",
@@ -161,7 +172,6 @@ Add the following to your `Fastfile`, inside the `build_app` function, just afte
161
172
build_path: "./builds",
162
173
output_directory: "./builds"
163
174
```
164
-
Make sure you have a `,` after the `scheme` parameter.
165
175
166
176
Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
167
177
:rocket: You are now ready to create your first beta build.
@@ -173,8 +183,8 @@ Creating a beta build and uploading it on TestFlight is now really easy.
173
183
Just type the following:
174
184
175
185
```
176
-
cd my-project/ios
177
-
fastlane beta
186
+
$ cd my-project/ios
187
+
$ fastlane beta
178
188
```
179
189
180
190
@@ -197,8 +207,8 @@ Before continuing make sure you have:
197
207
198
208
First you need to set up Fastlane for your android project:
199
209
```
200
-
cd my-project/android
201
-
fastlane init
210
+
$ cd my-project/android
211
+
$ fastlane init
202
212
```
203
213
204
214
Fastlane will automatically detect your project and ask for any missing information.
@@ -250,18 +260,35 @@ Creating a beta build and uploading it on Google Play is now really easy.
250
260
Just type the following:
251
261
252
262
```
253
-
cd my-project/android
254
-
fastlane beta
263
+
$ cd my-project/android
264
+
$ fastlane beta
255
265
```
256
266
257
267
If you have a `Permission denied` issue, please run:
258
268
```
259
-
chmod a+x /my-project/android/gradlew
269
+
$ chmod a+x /my-project/android/gradlew
260
270
```
261
271
272
+
262
273
## Troubleshooting
263
274
264
-
### Stuck at `bundle install` running `fastlane init`
275
+
### Stuck at `bundle install` or `bundle update` running `fastlane init`
276
+
277
+
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.
278
+
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:
279
+
```
280
+
$ sudo chown <your-user> <files>
281
+
```
282
+
265
283
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>`).
284
+
### Fastlane init failed
285
+
```
286
+
fastlane init failed
287
+
["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