fastlane-plugin-pcloudy 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +359 -69
- data/lib/fastlane/plugin/pcloudy/actions/pcloudy_list_devices_action.rb +12 -1
- data/lib/fastlane/plugin/pcloudy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c69d7626da330b6b8ac015de46582208494700304131a334d593f39607373fd
|
|
4
|
+
data.tar.gz: 12fff2303d1afbd9b9d99f602e537be47a6573b205c2c02e5d71e5ee715e6d47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2038af9094e39eeba6790cb69f9715c6eb3ccb5bbd0c25b3a06c3909a5843b61126c402bf4233649eb3023033216fa016080fc850e8f7367efa5cdba55d10f51
|
|
7
|
+
data.tar.gz: 36d245a82497c285e495a955124061632ee2e2554bf625f621bfeb489dc4161d755f6849b95e20e0735def17bb98bcd47b06555ec94ab1852cb817a642871715
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
- `fastlane run pcloudy_list_devices` no longer dumps every field of every device after the table: the
|
|
6
|
+
result now prints as a one-line summary ("Result: 21 pCloudy device(s)"). Lanes still get the full array.
|
|
7
|
+
- With `available_now: true` (the default), devices that pCloudy reports as available but `offline` are no
|
|
8
|
+
longer listed, since they can't be used.
|
|
9
|
+
- README rewritten as an integration guide: requirements, security, CI/CD examples, Appium integration,
|
|
10
|
+
error handling and troubleshooting.
|
|
11
|
+
|
|
3
12
|
## 0.3.0
|
|
4
13
|
|
|
5
14
|
- `pcloudy_upload_app` and `pcloudy_resign_app` now also set `PCLOUDY_UPLOADED_FILE`, `PCLOUDY_RESIGNED_FILE`
|
data/README.md
CHANGED
|
@@ -1,146 +1,436 @@
|
|
|
1
1
|
# fastlane-plugin-pcloudy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-pcloudy)
|
|
4
|
+
[](https://rubygems.org/gems/fastlane-plugin-pcloudy)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
The official [fastlane](https://fastlane.tools) plugin for [pCloudy](https://www.pcloudy.com), the real-device
|
|
8
|
+
cloud for iOS and Android. Connect your build pipeline to pCloudy: upload every build automatically, re-sign iOS
|
|
9
|
+
apps for pCloudy devices, find available devices, and hand the uploaded app to your Appium test suite, all from
|
|
10
|
+
your existing `Fastfile`.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Contents
|
|
15
|
+
|
|
16
|
+
- [Why use it](#why-use-it)
|
|
17
|
+
- [Capabilities](#capabilities)
|
|
18
|
+
- [Requirements](#requirements)
|
|
19
|
+
- [Installation](#installation)
|
|
20
|
+
- [Authentication and security](#authentication-and-security)
|
|
21
|
+
- [Quick start](#quick-start)
|
|
22
|
+
- [CI/CD integration](#cicd-integration)
|
|
23
|
+
- [Appium integration](#appium-integration)
|
|
24
|
+
- [Action reference](#action-reference)
|
|
25
|
+
- [Outputs and environment variables](#outputs-and-environment-variables)
|
|
26
|
+
- [Private and on-premise clouds](#private-and-on-premise-clouds)
|
|
27
|
+
- [Network requirements](#network-requirements)
|
|
28
|
+
- [Error handling](#error-handling)
|
|
29
|
+
- [Troubleshooting](#troubleshooting)
|
|
30
|
+
- [Versioning and support](#versioning-and-support)
|
|
31
|
+
- [Development](#development)
|
|
32
|
+
- [License](#license)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Why use it
|
|
37
|
+
|
|
38
|
+
- **No manual uploads.** Every CI build lands in pCloudy **My Apps** automatically, under the exact name pCloudy
|
|
39
|
+
assigned to it.
|
|
40
|
+
- **No iOS signing setup for testing.** Upload an `.ipa`, and the plugin has pCloudy re-sign it with
|
|
41
|
+
pCloudy's certificate so it installs on pCloudy iPhones and iPads. This works even for an **unsigned** `.ipa`,
|
|
42
|
+
so a test pipeline needs no Apple certificates or provisioning profiles.
|
|
43
|
+
- **Ready for test automation.** The uploaded app's name is exported as `PCLOUDY_APP_FILE`, so Appium suites
|
|
44
|
+
(Java, Python, JavaScript, …) pick it up with no extra wiring.
|
|
45
|
+
- **Device-aware pipelines.** Check which devices are free right now and filter by platform, OS version,
|
|
46
|
+
manufacturer or model before you start a test run.
|
|
47
|
+
- **Built for CI.** Credentials come from environment variables, secrets are masked in logs, and every failure
|
|
48
|
+
stops the lane with one clear message instead of a stack trace.
|
|
49
|
+
|
|
50
|
+
## Capabilities
|
|
51
|
+
|
|
52
|
+
| Action | What it does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| [`pcloudy_upload_app`](#pcloudy_upload_app) | Uploads an `.ipa`, `.apk` or `.aab` to My Apps, waits until pCloudy has registered it, and optionally re-signs the `.ipa`. Uses the output of `build_app` / `gradle` automatically. |
|
|
55
|
+
| [`pcloudy_resign_app`](#pcloudy_resign_app) | Re-signs an `.ipa` that's already in My Apps with pCloudy's certificate and waits for it to finish. |
|
|
56
|
+
| [`pcloudy_list_devices`](#pcloudy_list_devices) | Lists real iOS and Android devices, filtered by availability, platform, OS version, manufacturer and name. |
|
|
57
|
+
|
|
58
|
+
**Supported app formats:** `.ipa` (iOS, signed or unsigned), `.apk` and `.aab` (Android).
|
|
59
|
+
|
|
60
|
+
**Roadmap:** booking and releasing devices, installing and launching an app on a booked device, and running
|
|
61
|
+
XCUITest / Espresso / Appium suites with results reported back to the lane.
|
|
4
62
|
|
|
5
|
-
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
| Component | Supported |
|
|
6
66
|
|---|---|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
67
|
+
| fastlane | 2.220 or later |
|
|
68
|
+
| Ruby | 2.6 or later (Ruby 3.x recommended) |
|
|
69
|
+
| Build machine | macOS for iOS builds; macOS or Linux for Android and for uploads only |
|
|
70
|
+
| pCloudy | A pCloudy account with API access: public cloud ([device.pcloudy.com](https://device.pcloudy.com)), private cloud or on-premise |
|
|
71
|
+
|
|
72
|
+
> **macOS tip:** use Ruby from Homebrew (`brew install ruby`) or a version manager, not the system Ruby 2.6.
|
|
73
|
+
> Older Bundler versions that come with it crash on Ruby 3.2+ with ``undefined method `untaint'``.
|
|
12
74
|
|
|
13
75
|
## Installation
|
|
14
76
|
|
|
77
|
+
From the root of your app project:
|
|
78
|
+
|
|
15
79
|
```bash
|
|
16
|
-
fastlane add_plugin pcloudy
|
|
80
|
+
bundle exec fastlane add_plugin pcloudy
|
|
17
81
|
```
|
|
18
82
|
|
|
19
|
-
This adds
|
|
83
|
+
This adds the gem to `fastlane/Pluginfile`. Commit `Gemfile`, `Gemfile.lock` and `fastlane/Pluginfile` so every
|
|
84
|
+
developer and CI agent uses the same version.
|
|
85
|
+
|
|
86
|
+
To pin a version for reproducible builds, edit `fastlane/Pluginfile`:
|
|
20
87
|
|
|
21
|
-
|
|
88
|
+
```ruby
|
|
89
|
+
gem "fastlane-plugin-pcloudy", "~> 0.3"
|
|
90
|
+
```
|
|
22
91
|
|
|
23
|
-
|
|
92
|
+
To update later:
|
|
24
93
|
|
|
94
|
+
```bash
|
|
95
|
+
bundle update fastlane-plugin-pcloudy
|
|
25
96
|
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
97
|
+
|
|
98
|
+
## Authentication and security
|
|
99
|
+
|
|
100
|
+
The plugin signs in with your pCloudy **username** (the account email) and **API key** (pCloudy →
|
|
101
|
+
**Settings** → **API Key**).
|
|
102
|
+
|
|
103
|
+
| Setting | Environment variable | Notes |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| `username` | `PCLOUDY_USERNAME` | pCloudy account email |
|
|
106
|
+
| `api_key` | `PCLOUDY_API_KEY` | Marked sensitive: fastlane masks it in logs and summaries |
|
|
107
|
+
| `cloud_url` | `PCLOUDY_CLOUD_URL` | Optional. Defaults to `https://device.pcloudy.com` |
|
|
108
|
+
|
|
109
|
+
**Local development:** put the values in `fastlane/.env` and add that file to `.gitignore`:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# fastlane/.env (never commit this file)
|
|
113
|
+
PCLOUDY_USERNAME=qa-automation@your-company.com
|
|
114
|
+
PCLOUDY_API_KEY=<your API key>
|
|
29
115
|
```
|
|
30
116
|
|
|
117
|
+
**CI:** store both values in your CI system's secret store (GitHub Actions secrets, Jenkins credentials,
|
|
118
|
+
GitLab CI/CD variables, …) and expose them as environment variables. Never hard-code them in the `Fastfile`.
|
|
119
|
+
|
|
120
|
+
**Security notes**
|
|
121
|
+
|
|
122
|
+
- Credentials are sent only to the configured `cloud_url`, over HTTPS.
|
|
123
|
+
- The plugin exchanges the API key for a pCloudy session token, kept in memory for the current run only. It
|
|
124
|
+
doesn't write credentials or tokens to disk or to the log.
|
|
125
|
+
- Use a dedicated pCloudy account for automation, so its API key can be rotated without affecting people.
|
|
126
|
+
- Rotate the API key whenever it may have been exposed, for example after it has been pasted into a ticket or a chat.
|
|
127
|
+
- Releases of this gem require multi-factor authentication on RubyGems (`rubygems_mfa_required`).
|
|
128
|
+
|
|
129
|
+
**Data handled:** the app binary you upload is stored in your pCloudy account's **My Apps**. Re-signing creates
|
|
130
|
+
an additional copy there with `_Resigned` in its name. The plugin doesn't send any other data from the
|
|
131
|
+
build machine.
|
|
132
|
+
|
|
31
133
|
## Quick start
|
|
32
134
|
|
|
33
135
|
```ruby
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
136
|
+
# fastlane/Fastfile
|
|
137
|
+
|
|
138
|
+
platform :ios do
|
|
139
|
+
desc "Build, upload to pCloudy and re-sign for pCloudy devices"
|
|
140
|
+
lane :pcloudy do
|
|
141
|
+
build_app(scheme: "MyApp", export_method: "development")
|
|
142
|
+
pcloudy_upload_app(resign: true)
|
|
143
|
+
end
|
|
38
144
|
end
|
|
39
145
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
146
|
+
platform :android do
|
|
147
|
+
desc "Build and upload to pCloudy"
|
|
148
|
+
lane :pcloudy do
|
|
149
|
+
gradle(task: "assembleDebug") # or "bundleRelease" for an .aab
|
|
150
|
+
pcloudy_upload_app
|
|
151
|
+
end
|
|
44
152
|
end
|
|
45
153
|
```
|
|
46
154
|
|
|
47
|
-
|
|
155
|
+
```bash
|
|
156
|
+
bundle exec fastlane ios pcloudy
|
|
157
|
+
bundle exec fastlane android pcloudy
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The app appears in **pCloudy → My Apps**, ready to install on real devices manually or from automated tests.
|
|
161
|
+
|
|
162
|
+
Check your setup at any time:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
bundle exec fastlane run pcloudy_list_devices platform:ios
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## CI/CD integration
|
|
169
|
+
|
|
170
|
+
### GitHub Actions
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
# .github/workflows/pcloudy.yml
|
|
174
|
+
name: pCloudy
|
|
175
|
+
on: [push]
|
|
176
|
+
|
|
177
|
+
jobs:
|
|
178
|
+
ios:
|
|
179
|
+
runs-on: macos-latest
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
- uses: ruby/setup-ruby@v1
|
|
183
|
+
with:
|
|
184
|
+
bundler-cache: true
|
|
185
|
+
- run: bundle exec fastlane ios pcloudy
|
|
186
|
+
env:
|
|
187
|
+
PCLOUDY_USERNAME: ${{ secrets.PCLOUDY_USERNAME }}
|
|
188
|
+
PCLOUDY_API_KEY: ${{ secrets.PCLOUDY_API_KEY }}
|
|
189
|
+
|
|
190
|
+
android:
|
|
191
|
+
runs-on: ubuntu-latest
|
|
192
|
+
steps:
|
|
193
|
+
- uses: actions/checkout@v4
|
|
194
|
+
- uses: actions/setup-java@v4
|
|
195
|
+
with:
|
|
196
|
+
distribution: temurin
|
|
197
|
+
java-version: "17"
|
|
198
|
+
- uses: ruby/setup-ruby@v1
|
|
199
|
+
with:
|
|
200
|
+
bundler-cache: true
|
|
201
|
+
- run: bundle exec fastlane android pcloudy
|
|
202
|
+
env:
|
|
203
|
+
PCLOUDY_USERNAME: ${{ secrets.PCLOUDY_USERNAME }}
|
|
204
|
+
PCLOUDY_API_KEY: ${{ secrets.PCLOUDY_API_KEY }}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Jenkins (declarative pipeline)
|
|
208
|
+
|
|
209
|
+
```groovy
|
|
210
|
+
pipeline {
|
|
211
|
+
agent { label 'macos' }
|
|
212
|
+
environment {
|
|
213
|
+
PCLOUDY_USERNAME = credentials('pcloudy-username')
|
|
214
|
+
PCLOUDY_API_KEY = credentials('pcloudy-api-key')
|
|
215
|
+
}
|
|
216
|
+
stages {
|
|
217
|
+
stage('Install') { steps { sh 'bundle install' } }
|
|
218
|
+
stage('pCloudy') { steps { sh 'bundle exec fastlane ios pcloudy' } }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### GitLab CI
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
# .gitlab-ci.yml. Set PCLOUDY_USERNAME and PCLOUDY_API_KEY as masked CI/CD variables.
|
|
227
|
+
pcloudy_android:
|
|
228
|
+
image: ruby:3.3
|
|
229
|
+
script:
|
|
230
|
+
- bundle install
|
|
231
|
+
- bundle exec fastlane android pcloudy
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
For Android, the job's image also needs a JDK and the Android SDK, or a prebuilt APK/AAB passed with
|
|
235
|
+
`file:`.
|
|
48
236
|
|
|
49
|
-
##
|
|
237
|
+
## Appium integration
|
|
50
238
|
|
|
51
|
-
|
|
239
|
+
`pcloudy_upload_app` and `pcloudy_resign_app` export the uploaded app's name as the environment variable
|
|
240
|
+
`PCLOUDY_APP_FILE`. Any test runner started from the lane inherits it.
|
|
52
241
|
|
|
53
242
|
```ruby
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
243
|
+
platform :ios do
|
|
244
|
+
lane :pcloudy_tests do
|
|
245
|
+
build_app(scheme: "MyApp", export_method: "development")
|
|
246
|
+
pcloudy_upload_app(resign: true) # sets ENV["PCLOUDY_APP_FILE"] to the re-signed name
|
|
247
|
+
|
|
248
|
+
device = pcloudy_list_devices(platform: "ios", os_version: "17", print_table: false).first
|
|
249
|
+
UI.user_error!("No free iOS 17 device on pCloudy") unless device
|
|
250
|
+
ENV["PCLOUDY_DEVICE"] = device["full_name"]
|
|
251
|
+
|
|
252
|
+
sh("cd .. && mvn test") # or: pytest, npm test, gradle test, ...
|
|
253
|
+
end
|
|
58
254
|
end
|
|
59
255
|
```
|
|
60
256
|
|
|
257
|
+
In the test suite, read the values from the environment:
|
|
258
|
+
|
|
61
259
|
```java
|
|
260
|
+
caps.setCapability("pCloudy_Username", System.getenv("PCLOUDY_USERNAME"));
|
|
261
|
+
caps.setCapability("pCloudy_ApiKey", System.getenv("PCLOUDY_API_KEY"));
|
|
62
262
|
caps.setCapability("pCloudy_ApplicationName", System.getenv("PCLOUDY_APP_FILE"));
|
|
263
|
+
caps.setCapability("pCloudy_DeviceFullName", System.getenv("PCLOUDY_DEVICE"));
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
caps["pCloudy_ApplicationName"] = os.environ["PCLOUDY_APP_FILE"]
|
|
268
|
+
caps["pCloudy_DeviceFullName"] = os.environ["PCLOUDY_DEVICE"]
|
|
63
269
|
```
|
|
64
270
|
|
|
65
|
-
|
|
271
|
+
See pCloudy's Appium documentation for the full list of capabilities and the hub URL for your cloud.
|
|
66
272
|
|
|
67
|
-
|
|
273
|
+
> **Always use `PCLOUDY_APP_FILE`, not the local file name.** pCloudy renames an upload (adding a timestamp)
|
|
274
|
+
> when a file with the same name already exists, and re-signing produces a new `_Resigned` file.
|
|
68
275
|
|
|
69
|
-
|
|
276
|
+
## Action reference
|
|
277
|
+
|
|
278
|
+
All actions accept `username`, `api_key` and `cloud_url` (see
|
|
279
|
+
[Authentication and security](#authentication-and-security)).
|
|
280
|
+
|
|
281
|
+
### `pcloudy_upload_app`
|
|
282
|
+
|
|
283
|
+
Uploads an app to pCloudy My Apps. Platforms: iOS, Android.
|
|
70
284
|
|
|
71
285
|
```ruby
|
|
72
|
-
pcloudy_upload_app
|
|
73
|
-
pcloudy_upload_app(resign: true)
|
|
74
|
-
|
|
286
|
+
pcloudy_upload_app # output of build_app / gradle
|
|
287
|
+
pcloudy_upload_app(resign: true) # iOS: upload and re-sign in one step
|
|
288
|
+
pcloudy_upload_app(file: "build/MyApp.aab") # any file
|
|
75
289
|
```
|
|
76
290
|
|
|
77
|
-
|
|
291
|
+
If `file:` is omitted, the plugin uses, in this order: the `.ipa` from `build_app`/`gym`, the `.apk` from
|
|
292
|
+
`gradle` (`assemble…` tasks), then the `.aab` from `gradle` (`bundle…` tasks).
|
|
293
|
+
|
|
294
|
+
| Option | Environment variable | Default | Description |
|
|
78
295
|
|---|---|---|---|
|
|
79
|
-
| `file` | `PCLOUDY_APP_PATH` | output
|
|
296
|
+
| `file` | `PCLOUDY_APP_PATH` | build output | Path to the `.ipa`, `.apk` or `.aab` |
|
|
80
297
|
| `resign` | `PCLOUDY_RESIGN` | `false` | Re-sign the `.ipa` after uploading (iOS only) |
|
|
81
298
|
| `wait_for_processing` | `PCLOUDY_WAIT_FOR_PROCESSING` | `true` | Wait until the file appears in My Apps |
|
|
82
|
-
| `upload_timeout` | `PCLOUDY_UPLOAD_TIMEOUT` | `600` | Seconds allowed for the upload |
|
|
299
|
+
| `upload_timeout` | `PCLOUDY_UPLOAD_TIMEOUT` | `600` | Seconds allowed for the upload request |
|
|
83
300
|
| `processing_timeout` | `PCLOUDY_PROCESSING_TIMEOUT` | `120` | Seconds to wait for the file to appear in My Apps |
|
|
84
301
|
| `resign_timeout` | `PCLOUDY_RESIGN_TIMEOUT` | `600` | Seconds to wait for re-signing (with `resign: true`) |
|
|
85
|
-
| `poll_interval` | — | `5` | Seconds between re-sign progress checks
|
|
86
|
-
|
|
87
|
-
Plus `username`, `api_key` and `cloud_url`, as for every action.
|
|
302
|
+
| `poll_interval` | — | `5` | Seconds between re-sign progress checks |
|
|
88
303
|
|
|
89
304
|
**Returns:** the file name in My Apps (the re-signed copy when `resign: true`).
|
|
90
|
-
**Sets** (in `lane_context` and as environment variables): `PCLOUDY_UPLOADED_FILE`, `PCLOUDY_APP_FILE`, and with `resign: true`, `PCLOUDY_RESIGNED_FILE`. A new upload without `resign` clears `PCLOUDY_RESIGNED_FILE`.
|
|
91
305
|
|
|
92
|
-
|
|
306
|
+
### `pcloudy_resign_app`
|
|
93
307
|
|
|
94
|
-
Re-signs an `.ipa`
|
|
308
|
+
Re-signs an `.ipa` already in My Apps with pCloudy's certificate, so it installs on pCloudy iPhones and iPads.
|
|
309
|
+
Platform: iOS.
|
|
95
310
|
|
|
96
311
|
```ruby
|
|
97
312
|
pcloudy_upload_app
|
|
98
|
-
pcloudy_resign_app
|
|
313
|
+
pcloudy_resign_app # re-signs the last upload
|
|
99
314
|
|
|
100
|
-
pcloudy_resign_app(file: "MyApp-1794551836.ipa")
|
|
315
|
+
pcloudy_resign_app(file: "MyApp-1794551836.ipa") # a file already in My Apps
|
|
101
316
|
```
|
|
102
317
|
|
|
103
|
-
| Option |
|
|
318
|
+
| Option | Environment variable | Default | Description |
|
|
104
319
|
|---|---|---|---|
|
|
105
|
-
| `file` | `PCLOUDY_RESIGN_FILE` | last upload | File name in
|
|
320
|
+
| `file` | `PCLOUDY_RESIGN_FILE` | last upload | File name in My Apps |
|
|
106
321
|
| `timeout` | `PCLOUDY_RESIGN_TIMEOUT` | `600` | Seconds to wait for re-signing to finish |
|
|
107
322
|
| `poll_interval` | — | `5` | Seconds between progress checks |
|
|
108
323
|
|
|
109
324
|
**Returns:** the re-signed file name, e.g. `MyApp-1794551836_Resigned1794551854668.ipa`.
|
|
110
|
-
**Sets** (in `lane_context` and as environment variables): `PCLOUDY_RESIGNED_FILE` and `PCLOUDY_APP_FILE`.
|
|
111
325
|
|
|
112
|
-
|
|
326
|
+
### `pcloudy_list_devices`
|
|
327
|
+
|
|
328
|
+
Lists real devices on pCloudy. Platforms: iOS, Android.
|
|
113
329
|
|
|
114
330
|
```ruby
|
|
115
|
-
pcloudy_list_devices
|
|
116
|
-
pcloudy_list_devices(platform: "ios", os_version: "17")
|
|
117
|
-
devices = pcloudy_list_devices(platform: "android",
|
|
118
|
-
manufacturer: "Samsung",
|
|
119
|
-
print_table: false)
|
|
120
|
-
UI.message("First device id: #{devices.first['id']}")
|
|
331
|
+
pcloudy_list_devices # all devices free right now
|
|
332
|
+
pcloudy_list_devices(platform: "ios", os_version: "17") # iOS 17.x
|
|
333
|
+
devices = pcloudy_list_devices(platform: "android", manufacturer: "Samsung", print_table: false)
|
|
121
334
|
```
|
|
122
335
|
|
|
123
|
-
| Option |
|
|
336
|
+
| Option | Environment variable | Default | Description |
|
|
124
337
|
|---|---|---|---|
|
|
125
|
-
| `username` | `PCLOUDY_USERNAME` | — | pCloudy account email |
|
|
126
|
-
| `api_key` | `PCLOUDY_API_KEY` | — | pCloudy API key |
|
|
127
|
-
| `cloud_url` | `PCLOUDY_CLOUD_URL` | `https://device.pcloudy.com` | Cloud URL |
|
|
128
338
|
| `platform` | `PCLOUDY_PLATFORM` | `all` | `ios`, `android` or `all` |
|
|
129
|
-
| `available_now` | `PCLOUDY_AVAILABLE_NOW` | `true` | Only devices that are free now |
|
|
130
|
-
| `duration` | `PCLOUDY_DURATION` | `10` |
|
|
131
|
-
| `os_version` | `PCLOUDY_OS_VERSION` | — | OS version or prefix
|
|
132
|
-
| `manufacturer` | `PCLOUDY_MANUFACTURER` | — | e.g. `Apple`, `Samsung` |
|
|
133
|
-
| `name` | `PCLOUDY_DEVICE_NAME` | — | Text in the device name, e.g. `iPhone 15` |
|
|
134
|
-
| `print_table` | — | `true` | Print
|
|
339
|
+
| `available_now` | `PCLOUDY_AVAILABLE_NOW` | `true` | Only devices that are free right now |
|
|
340
|
+
| `duration` | `PCLOUDY_DURATION` | `10` | Booking length in minutes used for the availability check |
|
|
341
|
+
| `os_version` | `PCLOUDY_OS_VERSION` | — | OS version or prefix: `17` matches 17.x, `17.5` matches 17.5.x |
|
|
342
|
+
| `manufacturer` | `PCLOUDY_MANUFACTURER` | — | e.g. `Apple`, `Samsung` (case-insensitive) |
|
|
343
|
+
| `name` | `PCLOUDY_DEVICE_NAME` | — | Text in the device name, e.g. `iPhone 15` (ignores case and spaces) |
|
|
344
|
+
| `print_table` | — | `true` | Print the results as a table |
|
|
345
|
+
|
|
346
|
+
**Returns:** an array of device hashes with `id`, `full_name`, `display_name`, `model`, `manufacturer`,
|
|
347
|
+
`platform`, `version`, `available`, and more.
|
|
348
|
+
|
|
349
|
+
## Outputs and environment variables
|
|
350
|
+
|
|
351
|
+
Each result is available both in fastlane's `lane_context` and as an environment variable, so it can be read in
|
|
352
|
+
the `Fastfile` and by any process the lane starts.
|
|
353
|
+
|
|
354
|
+
| Name | Set by | Value |
|
|
355
|
+
|---|---|---|
|
|
356
|
+
| `PCLOUDY_APP_FILE` | upload, resign | **The file to test**: the re-signed copy if there is one, otherwise the upload |
|
|
357
|
+
| `PCLOUDY_UPLOADED_FILE` | upload | The name pCloudy stored the upload under |
|
|
358
|
+
| `PCLOUDY_RESIGNED_FILE` | upload with `resign: true`, resign | The re-signed file name. Cleared by a new upload without `resign` |
|
|
359
|
+
| `PCLOUDY_DEVICES` | list devices | The matching devices (`lane_context` only) |
|
|
360
|
+
|
|
361
|
+
```ruby
|
|
362
|
+
app = lane_context[SharedValues::PCLOUDY_APP_FILE] # in the Fastfile
|
|
363
|
+
```
|
|
135
364
|
|
|
136
|
-
|
|
365
|
+
## Private and on-premise clouds
|
|
366
|
+
|
|
367
|
+
Point the plugin at your cloud with `cloud_url` or `PCLOUDY_CLOUD_URL`:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
PCLOUDY_CLOUD_URL=https://your-company.pcloudy.com
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
The scheme is optional (`your-company.pcloudy.com` is treated as `https://your-company.pcloudy.com`), and a
|
|
374
|
+
trailing slash is ignored.
|
|
375
|
+
|
|
376
|
+
## Network requirements
|
|
377
|
+
|
|
378
|
+
- Outbound **HTTPS (port 443)** from the build machine to the `cloud_url` host.
|
|
379
|
+
- Uploads send the full app binary, so allow for large request bodies and adjust `upload_timeout` on slow links.
|
|
380
|
+
- **Proxies:** Ruby's HTTP client, which the plugin uses, reads the `http_proxy` and `no_proxy` environment variables.
|
|
381
|
+
|
|
382
|
+
## Error handling
|
|
383
|
+
|
|
384
|
+
Every failure stops the lane with a single, readable `fastlane` error, so CI logs show the cause directly:
|
|
385
|
+
|
|
386
|
+
| Situation | Message |
|
|
387
|
+
|---|---|
|
|
388
|
+
| Missing credentials | `No value found for 'username'` |
|
|
389
|
+
| Wrong username or API key | `pCloudy /api/access failed: wrong user name` |
|
|
390
|
+
| HTTP error from pCloudy | `pCloudy /api/... returned HTTP 401: <pCloudy's message>` |
|
|
391
|
+
| Network failure (DNS, timeout, refused or dropped connection, TLS) | `Could not reach pCloudy at https://…: <reason>` |
|
|
392
|
+
| Unsupported file | `Unsupported file type '.zip'. pCloudy apps must be .ipa, .apk, .aab` |
|
|
393
|
+
| Re-signing a non-iOS app | `Only iOS apps (.ipa) can be re-signed on pCloudy` |
|
|
394
|
+
| Upload not registered in time | `<name> did not appear in pCloudy My Apps within 120s` |
|
|
395
|
+
| Re-signing not finished in time | `Re-signing <name> did not finish within 600s (last progress 40%)` |
|
|
396
|
+
|
|
397
|
+
Network failures are not retried automatically. For an unreliable connection, retry the lane step in your CI
|
|
398
|
+
configuration.
|
|
399
|
+
|
|
400
|
+
## Troubleshooting
|
|
401
|
+
|
|
402
|
+
| Problem | Fix |
|
|
403
|
+
|---|---|
|
|
404
|
+
| ``undefined method `untaint'`` when running fastlane | An old Bundler is running on a new Ruby. Use Homebrew's or a version manager's Ruby, and always run `bundle exec fastlane`. |
|
|
405
|
+
| `No value found for 'username'` | `PCLOUDY_USERNAME` / `PCLOUDY_API_KEY` are not set. Check `fastlane/.env` or your CI secrets, and run from the project root. |
|
|
406
|
+
| `wrong user name` | The username or API key is wrong, or the key was regenerated. Copy it again from pCloudy → Settings → API Key. |
|
|
407
|
+
| The app doesn't install on an iOS device | Upload with `resign: true` and install the `_Resigned` file (`PCLOUDY_APP_FILE`). |
|
|
408
|
+
| Appium reports "application not found" | Use `PCLOUDY_APP_FILE`, not the local file name. pCloudy may have renamed the upload. |
|
|
409
|
+
| `Could not reach pCloudy` | Check VPN or proxy settings, firewall rules for port 443 and `PCLOUDY_CLOUD_URL`. |
|
|
410
|
+
| `did not appear in pCloudy My Apps` | pCloudy is slow to process large files. Raise `processing_timeout`. |
|
|
411
|
+
| No devices returned | All matching devices are busy. Try `available_now: false` to see every device, or relax the filters. |
|
|
412
|
+
|
|
413
|
+
## Versioning and support
|
|
414
|
+
|
|
415
|
+
- The plugin follows [Semantic Versioning](https://semver.org). Changes are listed in [CHANGELOG.md](CHANGELOG.md),
|
|
416
|
+
which ships with the gem.
|
|
417
|
+
- Published on RubyGems as [`fastlane-plugin-pcloudy`](https://rubygems.org/gems/fastlane-plugin-pcloudy),
|
|
418
|
+
maintained by pCloudy.
|
|
419
|
+
- For help, contact pCloudy support through [pcloudy.com](https://www.pcloudy.com) or your pCloudy account
|
|
420
|
+
team. Include the plugin version (`bundle exec gem list fastlane-plugin-pcloudy`), the fastlane version and
|
|
421
|
+
the error message.
|
|
422
|
+
- To report a security issue, contact pCloudy privately rather than posting it publicly.
|
|
137
423
|
|
|
138
424
|
## Development
|
|
139
425
|
|
|
140
426
|
```bash
|
|
141
427
|
bundle install
|
|
142
|
-
bundle exec rspec
|
|
143
|
-
bundle exec fastlane list_devices platform:ios
|
|
428
|
+
bundle exec rspec # unit tests (all HTTP calls are stubbed)
|
|
429
|
+
bundle exec fastlane list_devices platform:ios # live calls; needs fastlane/.env
|
|
144
430
|
bundle exec fastlane upload file:/path/App.ipa resign:true
|
|
145
431
|
bundle exec fastlane resign file:App-1794551836.ipa
|
|
146
432
|
```
|
|
433
|
+
|
|
434
|
+
## License
|
|
435
|
+
|
|
436
|
+
[MIT](LICENSE) © Smart Software Testing Solutions
|
|
@@ -21,7 +21,7 @@ module Fastlane
|
|
|
21
21
|
available_now: params[:available_now])
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
devices = filter(devices, params)
|
|
24
|
+
devices = DeviceList.new(filter(devices, params))
|
|
25
25
|
|
|
26
26
|
print_table(devices, params) if params[:print_table]
|
|
27
27
|
UI.success("Found #{devices.count} pCloudy device(s)")
|
|
@@ -32,8 +32,19 @@ module Fastlane
|
|
|
32
32
|
UI.user_error!(e.message)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# An ordinary Array of device hashes for lanes, which prints as a one-line summary. `fastlane run` prints
|
|
36
|
+
# "Result: <return value>"; without this it would dump every field of every device on one line.
|
|
37
|
+
class DeviceList < Array
|
|
38
|
+
def to_s
|
|
39
|
+
"#{size} pCloudy device(s)"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
def self.filter(devices, params)
|
|
36
44
|
devices.select do |device|
|
|
45
|
+
# pCloudy can report a device as available while it's offline; it can't be used then.
|
|
46
|
+
next false if params[:available_now] && device["status"].to_s.casecmp?("offline")
|
|
47
|
+
|
|
37
48
|
matches_version?(device["version"], params[:os_version]) &&
|
|
38
49
|
matches_text?(device["manufacturer"], params[:manufacturer]) &&
|
|
39
50
|
matches_name?(device, params[:name])
|