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
A lot of developers loves write React Native code.
4
-
No developer likes to deploy RN app or distribute beta builds.
3
+
Developers love writing React Native code but no one likes deploying React Native app or distributing beta builds.
5
4
6
5
All your headaches will disappear with this documentation and the amazing [Fastlane](https://fastlane.tools/) tool :)
7
6
8
7
## Before you start
9
8
10
9
You need a Mac. I'm sorry, but if you are a Windows user, you can stop reading right now.
11
-
Fastlane will not work on Windows PC.
12
-
But in all cases, if you need to deploy your app on IOS, you must have a Mac.
10
+
Fastlane will not work on Windows PC. But in all cases, if you need to deploy your app on IOS, you must have a Mac.
13
11
14
12
Let's explain which tools we are using to distribute beta builds:
15
-
*[Fastlane](https://fastlane.tools/), the easiest way to automate beta deployments and releases for your iOS and Android apps. It handles all tedious tasks, like generating screenshots, dealing with code signing, and releasing your application.
16
-
*[TestFlight](https://developer.apple.com/testflight/), part of App Store Connect and let you build your app and invite internal or external users to test it
17
-
*[Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which can also make same works as TestFlight, for Android users
13
+
*[Fastlane](https://fastlane.tools/), the easiest way to automate beta deployments and releases for your iOS and Android apps. It handles all tedious tasks like generating screenshots, dealing with code signing and releasing your application.
14
+
*[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
+
*[Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which does the same job as TestFlight for Android apps
18
16
19
17
## Installing Fastlane
20
18
21
-
First, you need to install Fastlane on your Mac, following these steps:
19
+
First you need to install Fastlane on your Mac. Follow these steps:
22
20
23
21
1. Install the latest Xcode command line tools:
24
22
```
25
23
xcode-select --install
26
24
```
27
-
2. Install Ruby
25
+
2. Install Ruby using [Homebrew](https://brew.sh/):
28
26
```
29
27
brew install ruby
30
28
```
31
-
3. Install Fastlane with RubyGems
29
+
3. Install Fastlane with RubyGems:
32
30
```
33
31
sudo gem install fastlane -NV
34
32
```
35
33
36
-
You are now ready to setting up Fastlane for iOS and Android :rocket:
34
+
You are now ready to set up Fastlane for iOS and Android :rocket:
37
35
38
36
## iOS
39
37
40
38
### Prerequisites
41
39
42
-
Before continue reading, make sure you have:
40
+
Before continuing make sure you have:
43
41
44
42
-[ ] Xcode 9 or higher
45
43
-[ ] Choose the [bundle identifier](https://cocoacasts.com/what-are-app-ids-and-bundle-identifiers/) of your app (for example `com.tcm.boilerplate`)
46
-
-[ ] An Apple ID with an admin user, with its username (email, for example `dev-team@thecodingmachine.com`) and password
47
-
-[ ] Your app name, if not alreay created on the Developer Portal (for example `TCM React Native Boilerplate`). Fastlane can create applications in Developer Portal and App Store Connect, so it's recommended to let Fastlane do the right job for you.
48
-
-[ ] Use the right [.gitignore](ios/.gitignore) file inside `ios` directory
44
+
-[ ] An Apple ID with an admin user, with its username (email, for example `dev-team@yourcompany.com`) and password
45
+
-[ ] 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
+
-[ ] Use the right [.gitignore](ios/.gitignore) file inside the `ios` directory
49
47
50
-
Open your Xcode project, and modify some information:
48
+
Open your Xcode project and modify some information:
51
49
52
-
-[ ] In the `General` tab, `Identity` section, change your`Bundle Identifier`with the good one
53
-
-[ ] In the `General` tab, `Signing` section, disabled`Automatically manage signing`
54
-
-[ ] In the `Build Settings` tab, under `Signing`, set `Don't Code Sign` as the `debug` codesigning identitiy and `iOS Distribution` as the `release` codesigning identitiy (for both `Debug`/`Release` and `Any iOS SDK`).
50
+
-[ ] In the `General` tab, `Identity` section, change the`Bundle Identifier`to your identifier
51
+
-[ ] 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`).
55
53
56
54
### Setting up
57
55
58
-
First, you need to setting up fastlane for your iOS project.
56
+
First you need to set up Fastlane for your iOS project:
59
57
```
60
58
cd my-project/ios
61
59
fastlane init
62
60
```
63
61
64
-
Fastlane will automatically detect your project, and ask for any missing information.
62
+
Fastlane will automatically detect your project and ask for any missing information.
65
63
66
-
Following questions will be asked:
64
+
The following questions will be asked:
67
65
*`What would you like to use fastlane for?`
68
-
* For this tutorial, good answer is `2 - Automate beta distribution to TestFlight`
66
+
* For this tutorial a good answer is `2 - Automate beta distribution to TestFlight`
69
67
*`Select Scheme:`
70
-
* Here, we will select the scheme without `-tvOS` suffix
68
+
* Here we will select the scheme without `-tvOS` suffix
71
69
*`Apple ID Username:`
72
-
* If you don't know, you don't have read the "Prerequisites" step :)
73
-
Our answer is `dev-team@thecodingmachine.com`
70
+
* If you don't know, you didn't read the "Prerequisites" step :)
71
+
Our answer is `dev-team@yourcompany.com`
74
72
*`Password (for Apple ID Username):`
75
-
* If you don't know, you don't have read the "Prerequisites" step :)
73
+
* If you don't know, you didn't read the "Prerequisites" step :)
76
74
Our answer is `keep it secret`
77
75
78
-
79
76
At this step, you may have the following issue:
80
77
```
81
78
fastlane init failed
82
79
["The request could not be completed because:", "Could not receive latest API key from App Store Connect, this might be a server issue."]
83
80
Something failed while running `fastlane init`
84
-
Tried using Apple ID with email 'dev-team@thecodingmachine.com'
81
+
Tried using Apple ID with email 'dev-team@yourcompany.com'
85
82
You can either retry, or fallback to manual setup which will create a basic Fastfile
86
83
Would you like to fallback to a manual Fastfile? (y/n)
87
84
```
88
-
Answer `n`, and retry previous steps, with a good Apple ID and password.
89
-
Be sure you are connected to internet
85
+
Answer `n`, and retry previous steps with a correct Apple ID and password.
86
+
Make sure you are connected to internet.
90
87
91
88
* 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:`
92
89
* Select the right team
93
90
* 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:`
94
91
* Select the right team
95
-
* If you don't have already create the App on the Developer Portal, Fastlane can do it for you ! (else you must have a message `Your app 'com.tcm.boilerplate' is available in your Apple Developer Portal`)
96
-
* It will ask `Do you want fastlane to create the App ID for you on the Apple Developer Portal? (y/n)`
97
-
* Type `y`
98
-
*`App Name`:
99
-
*`TCM React Native Boilerplate`
100
-
101
-
* If you haven't already create the App on the App Store Connect, Fastlane can do it for you ! (else you must have a message `Your app 'com.tcm.boilerplate' is available on App Store Connect`)
102
-
* It will ask `Would you like fastlane to create the App on App Store Connect for you? (y/n)`
92
+
* If you havent't already created the App on the Developer Portal or App Store Connect, Fastlane can do it for you! (else you must have a message `Your app 'com.tcm.boilerplate' is available in your Apple Developer Portal / App Store Connect`)
93
+
* It will ask `Do you want fastlane to create the App ID for you on the Apple Developer Portal / App Store Connect? (y/n)`
103
94
* Type `y`
104
95
*`App Name`:
105
96
*`TCM React Native Boilerplate`
106
97
107
-
108
-
Then, Fastlane will give you some informations about git, files it will create, etc. Just type `enter` to continue.
98
+
Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
109
99
110
100
Congrats! Fastlane has created some files.
111
101
If you are using Git, commit all generated files.
112
102
113
-
114
-
Once setup is ended, you can see a new folder inside the `ios` folder
103
+
Once the setup has finished you can see a new folder inside the `ios` folder:
115
104
```
116
105
- fastlane/
117
106
- Appfile
118
107
- Fastfile
119
108
```
120
109
121
-
`Appfile` contains identifiers used for the connection with Developer Portal and App Store Connect.
122
-
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile)
110
+
`Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
111
+
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
123
112
124
-
`Fastfile` contains all actions you can launch
125
-
You can read more about this file [here](https://docs.fastlane.tools/actions)
126
-
Because we previously choose`Automate beta distribution to TestFlight` on setting up step, a `beta`[lane](https://docs.fastlane.tools/advanced/lanes/) is available by default.
127
-
This `lane` contains three actions:
113
+
`Fastfile` contains all actions you can launch.
114
+
You can read more about this file [here](https://docs.fastlane.tools/actions).
115
+
Because we previously chose`Automate beta distribution to TestFlight` on set up, a `beta`[lane](https://docs.fastlane.tools/advanced/lanes/) is available by default.
116
+
This `lane` contains 3 actions:
128
117
* increment the build number of your app
129
118
* build your app
130
119
* upload to TestFlight
131
120
132
121
### Code signing
133
122
134
-
Code 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.
123
+
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.
135
124
136
-
A full guide is available on the fastlane doc, describing best approachs for your [code signing process](https://docs.fastlane.tools/codesigning/getting-started/)
125
+
A full guide is available on the fastlane doc, describing the best approaches for your [code signing process](https://docs.fastlane.tools/codesigning/getting-started/).
137
126
138
127
Using `match` is probably [the best solution](https://codesigning.guide/).
139
128
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).
@@ -158,7 +147,7 @@ Add the following to your `Fastfile`, just after the `increment_build_number` fu
158
147
)
159
148
```
160
149
161
-
Then, we need to configure provisionning profile for the build step.
150
+
Then, we need to configure the provisioning profile for the build step.
162
151
163
152
Add the following to your `Fastfile`, inside the `build_app` function, just after the `scheme` parameter:
164
153
```
@@ -171,18 +160,18 @@ Add the following to your `Fastfile`, inside the `build_app` function, just afte
171
160
},
172
161
build_path: "./builds",
173
162
output_directory: "./builds"
174
-
```
175
-
Make sure you added a `,` after the `scheme` parameter
163
+
```
164
+
Make sure you have a `,` after the `scheme` parameter.
176
165
177
-
The complete file can be found [here](ios/fastlane/Fastfile)
166
+
The complete file can be found [here](ios/fastlane/Fastfile).
178
167
179
-
Doing this step, when you will create a beta build, the Certificates and Provisioning Profile will be automatically created !
180
-
:rocket: You are now ready to create your first beta build
168
+
Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
169
+
:rocket: You are now ready to create your first beta build.
181
170
182
171
183
-
### Create a beta build
172
+
### Creating a beta build
184
173
185
-
Create a beta build and upload it on TestFlight is now really easy.
174
+
Creating a beta build and uploading it on TestFlight is now really easy.
0 commit comments