Skip to content

Commit fe9229c

Browse files
committed
Update testing-ios.md
1 parent 3658500 commit fe9229c

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

jekyll/_cci2/testing-ios.md

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ example of a minimal config in the
7676

7777
It is recommended to add a `Gemfile` to your repository to make sure that the same version of Fastlane is used both locally and on CircleCI and that all dependencies are installed. Below is a sample of a simple `Gemfile`:
7878

79-
```
79+
```ruby
8080
# Gemfile
8181
source "https://rubygems.org"
8282
gem 'fastlane'
@@ -89,7 +89,7 @@ After you have created a `Gemfile` locally, you will need to run `bundle install
8989

9090
When using Fastlane in your CircleCI project, we recommend adding the following to beginning of your `Fastfile`:
9191

92-
```
92+
```ruby
9393
# fastlane/Fastfile
9494

9595
...
@@ -114,7 +114,7 @@ new code signing certificates or provisioning profiles.
114114

115115
A basic Fastlane configuration that can be used on CircleCI is as follows:
116116

117-
```
117+
```ruby
118118
# fastlane/Fastfile
119119
default_platform :ios
120120

@@ -207,6 +207,7 @@ If you want to run steps with a version of Ruby that is listed as "available to
207207
The [`chruby`](https://github.com/postmodern/chruby) program is installed on the image and can be used to select a version of Ruby. The auto-switching feature is not enabled by default. To select a version of Ruby to use, add the `chruby` function to `~/.bash_profile`:
208208

209209
```yaml
210+
# ...
210211
run:
211212
name: Set Ruby Version
212213
command: echo 'chruby ruby-2.6' >> ~/.bash_profile
@@ -223,6 +224,7 @@ To specify a version of Ruby to use, there are two options. You can [create a fi
223224
If you do not want to commit a `.ruby-version` file to source control, then you can create the file from a job step:
224225

225226
```yaml
227+
# ...
226228
run:
227229
name: Set Ruby Version
228230
command: echo "ruby-2.4" > ~/.ruby-version
@@ -241,48 +243,46 @@ To make sure the version of CocoaPods that you use locally is also used
241243
in your CircleCI builds, we suggest creating a Gemfile in your iOS
242244
project and adding the CocoaPods version to it:
243245

244-
```
246+
```ruby
245247
source 'https://rubygems.org'
246248
247249
gem 'cocoapods', '= 1.3.0'
248250
```
249251

250252
Then you can install these using bundler:
251253

252-
{% raw %}
253-
```
254-
steps:
255-
- restore_cache:
256-
key: 1-gems-{{ checksum "Gemfile.lock" }}
257-
258-
- run: bundle check || bundle install --path vendor/bundle
259-
260-
- save_cache:
261-
key: 1-gems-{{ checksum "Gemfile.lock" }}
262-
paths:
263-
- vendor/bundle
254+
```yaml
255+
steps:
256+
- restore_cache:
257+
key: 1-gems-{{ checksum "Gemfile.lock" }}
258+
- run: bundle check || bundle install --path vendor/bundle
259+
- save_cache:
260+
key: 1-gems-{{ checksum "Gemfile.lock" }}
261+
paths:
262+
- vendor/bundle
264263
```
265-
{% endraw %}
266264

267265
You can then ensure you are using those, by prefixing commands with `bundle exec`:
268266

269-
```
270-
steps:
271-
- run: bundle exec pod install
267+
```yaml
268+
# ...
269+
steps:
270+
- run: bundle exec pod install
272271
```
273272

274273
## Using Homebrew
275274

276275
[Homebrew](http://brew.sh/) is pre-installed on CircleCI, so you can simply use `brew install` to add nearly any dependency you require to complete your build. For example:
277276

278-
```
279-
steps:
280-
- run:
281-
name: Install cowsay
282-
command: brew install cowsay
283-
- run:
284-
name: cowsay hi
285-
command: cowsay Hi!
277+
```yaml
278+
# ...
279+
steps:
280+
- run:
281+
name: Install cowsay
282+
command: brew install cowsay
283+
- run:
284+
name: cowsay hi
285+
command: cowsay Hi!
286286
```
287287

288288
It is also possible to use the `sudo` command if necessary to perform customizations outside of Homebrew.
@@ -306,10 +306,11 @@ To pre-start the simulator, add the following to your
306306
simulator with iOS 13.2:
307307

308308
```yaml
309-
steps:
310-
- run:
311-
name: pre-start simulator
312-
command: xcrun instruments -w "iPhone 11 Pro (13.3) [" || true
309+
# ...
310+
steps:
311+
- run:
312+
name: pre-start simulator
313+
command: xcrun instruments -w "iPhone 11 Pro (13.3) [" || true
313314
```
314315

315316
**Note:** the `[` character is necessary to uniquely identify the iPhone 7
@@ -326,9 +327,9 @@ Often if your `scan` step fails, for example due to a test runner timeout, it is
326327

327328
```yaml
328329
steps:
329-
# ...
330-
- store_artifacts:
331-
path: ~/Library/Logs/DiagnosticReports
330+
# ...
331+
- store_artifacts:
332+
path: ~/Library/Logs/DiagnosticReports
332333
```
333334

334335
### Optimzing Fastlane

0 commit comments

Comments
 (0)