Skip to content

Commit a04a0cc

Browse files
authored
chore(docs): Add cli docs for portals serve ios (#252)
1 parent 4b68a6e commit a04a0cc

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: CLI Command - serve ios
3+
sidebar_label: serve ios
4+
---
5+
6+
The `portals serve ios` command is a tool for web developers to debug and test their
7+
web code in different Portal configurations on a simulator or a device without having
8+
to go through the build process of a native application or even have access to its
9+
source code. The command allows web developers to run their web code from their local
10+
dev server and see the changes on the fly.
11+
12+
### Usage
13+
```bash
14+
portals serve ios [simulator | device] \
15+
--application /path/to/your/ios.app \
16+
--dev-server http://localhost:8100
17+
```
18+
This command will present an interactive list of eligible destination since no specific device details were provided. When selected, the command will launch the iOS app to the selected device and will override all portals with the content served from the development server URL by default. If a capacitor.config.{json, ts, js} file is located in the current working directory, it will use that, otherwise it will fallback to any configuration potentially shipped in the application.
19+
20+
### Examples
21+
22+
#### Specify capacitor configuration file
23+
24+
```bash
25+
portals serve ios [simulator | device] \
26+
--application /path/to/your/ios.app \
27+
--dev-server http://localhost:8100 \
28+
--capacitor-config /path/to/your/capacitor.config.ts
29+
```
30+
31+
#### Specify device details
32+
33+
If you know the specific device ID of the device you want to target, you can use the `--device-id` flag:
34+
35+
```bash
36+
portals serve ios [simulator | device] \
37+
--application /path/to/your/ios.app \
38+
--dev-server http://localhost:8100 \
39+
--device-id "deadbeef-dead-beef-dead-beefdeadbeef"
40+
```
41+
42+
Alternatively, you can use a combination of device name and OS version to target an eligible simulator:
43+
44+
```bash
45+
portals serve ios simulator \
46+
--application /path/to/your/ios.app \
47+
--dev-server http://localhost:8100 \
48+
--device-name "iPhone 12" \
49+
--device-os-version "14.0"
50+
```
51+
52+
Or you can specify the device name to target an eligible physical device:
53+
54+
```bash
55+
portals serve ios device \
56+
--application /path/to/your/ios.app \
57+
--dev-server http://localhost:8100 \
58+
--device-name "Carl's iPhone 15"
59+
```
60+
61+
#### Specify portal name
62+
63+
If you want to override only portals with a specific name, use the `--portal-name` flag:
64+
65+
```bash
66+
portals serve ios [simulator | device] \
67+
--application /path/to/your/ios.app \
68+
--dev-server http://localhost:8100 \
69+
--portal-name "profile"
70+
```
71+
### Flags:
72+
- `--device-id` **(string)** The ID of the target device.
73+
- `--device-name` **(string)** The name of the device. ('iPhone 13 Pro Max')
74+
- `-h, --help` help for ios
75+
76+
### Global Flags:
77+
- `--application` **(string)** Path to the native application. (required)
78+
- `--dev-server` **(string)** URL of the development server. (required)
79+
- `--capacitor-config` **(string)** Path to the capacitor configuration file.
80+
- `--portal-name` **(string)** The name of the target Portal. (default "PORTAL")
81+
- `--config` **(string)** config file (default $PWD/.portals.yaml)
82+

website/sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ module.exports = {
229229
type: "category",
230230
label: "Command Reference",
231231
collapsed: true,
232-
items: ["cli/commands/poc", "cli/commands/sync"],
232+
items: ["cli/commands/poc", "cli/commands/sync", "cli/commands/serve-ios"],
233233
},
234234
],
235235
},

0 commit comments

Comments
 (0)