Skip to content

Commit ba265eb

Browse files
committed
adding some information for Fastlane
1 parent a04d3a3 commit ba265eb

File tree

1 file changed

+62
-33
lines changed

1 file changed

+62
-33
lines changed

docs/beta builds.md

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Developers love writing React Native code but no one likes deploying React Nativ
44

55
All your headaches will disappear with this documentation and the amazing [Fastlane](https://fastlane.tools/) tool :)
66

7+
78
## Before you start
89

910
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:
1415
* [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
1516
* [Google Play](https://support.google.com/googleplay/android-developer/answer/3131213?hl=fr), which does the same job as TestFlight for Android apps
1617

18+
1719
## Installing Fastlane
1820

1921
First you need to install Fastlane on your Mac. Follow these steps:
2022

2123
1. Install the latest Xcode command line tools:
2224
```
23-
xcode-select --install
25+
$ xcode-select --install
2426
```
2527
2. Install Ruby using [Homebrew](https://brew.sh/):
2628
```
27-
brew install ruby
29+
$ brew install ruby
2830
```
2931
3. Install Fastlane with RubyGems:
3032
```
31-
sudo gem install fastlane -NV
33+
$ sudo gem install fastlane -NV
3234
```
3335

3436
You are now ready to set up Fastlane for iOS and Android :rocket:
3537

38+
3639
## iOS
3740

3841
### Prerequisites
@@ -44,21 +47,35 @@ Before continuing make sure you have:
4447
- [ ] An Apple ID with an admin user, with its username (email, for example `[email protected]`) and password
4548
- [ ] 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.
4649
- [ ] 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/)
4751

4852
Open your Xcode project and modify some information:
4953

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)
5155
- [ ] 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+
5367

5468
### Setting up
5569

5670
First you need to set up Fastlane for your iOS project:
5771
```
58-
cd my-project/ios
59-
fastlane init
72+
$ cd my-project/ios
73+
$ fastlane init
6074
```
6175

76+
*Note: If you have an error on this step, please see the `issues` section.*
77+
78+
6279
Fastlane will automatically detect your project and ask for any missing information.
6380

6481
The following questions will be asked:
@@ -73,18 +90,6 @@ The following questions will be asked:
7390
* If you don't know, you didn't read the "Prerequisites" step :)
7491
Our answer is `keep it secret`
7592

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."]
80-
Something failed while running `fastlane init`
81-
Tried using Apple ID with email '[email protected]'
82-
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-
8893
* 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:`
8994
* Select the right team
9095
* 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.
97102

98103
Fastlane will then give you some information about git, the files it will create, etc. Just type `enter` to continue.
99104

100-
Congrats! Fastlane has created some files.
105+
**Congrats!** Fastlane has created some files.
106+
101107
If you are using Git, commit all generated files.
102108

109+
Before running any Fastlane command
110+
103111
Once the setup has finished you can see a new folder inside the `ios` folder:
104112
```
105113
- fastlane/
106114
- Appfile
107115
- Fastfile
108116
```
109117

118+
It's not finish, you need to follow `Code Signing` part to setting up a provisioning profile.
119+
120+
For information:
121+
110122
`Appfile` contains identifiers used to connect to the Developer Portal and App Store Connect.
111123
You can read more about this file [here](https://docs.fastlane.tools/advanced/#appfile).
112124

@@ -118,6 +130,7 @@ This `lane` contains 3 actions:
118130
* build your app
119131
* upload to TestFlight
120132

133+
121134
### Code signing
122135

123136
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
127140
Using `match` is probably [the best solution](https://codesigning.guide/).
128141
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).
129142

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):
131144
```
132145
get_certificates( # Create or get certificate, and install it
133146
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
149162

150163
Then, we need to configure the provisioning profile for the build step.
151164

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):
153166
```
154167
clean: true,
155168
export_method: "app-store",
@@ -161,7 +174,6 @@ Add the following to your `Fastfile`, inside the `build_app` function, just afte
161174
build_path: "./builds",
162175
output_directory: "./builds"
163176
```
164-
Make sure you have a `,` after the `scheme` parameter.
165177

166178
Thanks to this the Certificates and Provisioning Profile will be automatically created when you will create a beta build!
167179
: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.
173185
Just type the following:
174186

175187
```
176-
cd my-project/ios
177-
fastlane beta
188+
$ cd my-project/ios
189+
$ fastlane beta
178190
```
179191

180192

@@ -197,8 +209,8 @@ Before continuing make sure you have:
197209

198210
First you need to set up Fastlane for your android project:
199211
```
200-
cd my-project/android
201-
fastlane init
212+
$ cd my-project/android
213+
$ fastlane init
202214
```
203215

204216
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.
250262
Just type the following:
251263

252264
```
253-
cd my-project/android
254-
fastlane beta
265+
$ cd my-project/android
266+
$ fastlane beta
255267
```
256268

257269
If you have a `Permission denied` issue, please run:
258270
```
259-
chmod a+x /my-project/android/gradlew
271+
$ chmod a+x /my-project/android/gradlew
260272
```
261273

274+
262275
## Troubleshooting
263276

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+
265285

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."]
290+
Something failed while running `fastlane init`
291+
Tried using Apple ID with email '[email protected]'
292+
You can either retry, or fallback to manual setup which will create a basic Fastfile
293+
Would you like to fallback to a manual Fastfile? (y/n)
294+
```
295+
Answer `n`, and retry previous steps with a correct Apple ID and password.
296+
Make sure you are connected to internet.

0 commit comments

Comments
 (0)