Skip to content

Commit

Permalink
chore(docs): Add cli docs for portals serve ios (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven0351 committed Dec 4, 2023
1 parent 4b68a6e commit a04a0cc
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions website/docs/cli/commands/serve-ios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: CLI Command - serve ios
sidebar_label: serve ios
---

The `portals serve ios` command is a tool for web developers to debug and test their
web code in different Portal configurations on a simulator or a device without having
to go through the build process of a native application or even have access to its
source code. The command allows web developers to run their web code from their local
dev server and see the changes on the fly.

### Usage
```bash
portals serve ios [simulator | device] \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100
```
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.

### Examples

#### Specify capacitor configuration file

```bash
portals serve ios [simulator | device] \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100 \
--capacitor-config /path/to/your/capacitor.config.ts
```

#### Specify device details

If you know the specific device ID of the device you want to target, you can use the `--device-id` flag:

```bash
portals serve ios [simulator | device] \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100 \
--device-id "deadbeef-dead-beef-dead-beefdeadbeef"
```

Alternatively, you can use a combination of device name and OS version to target an eligible simulator:

```bash
portals serve ios simulator \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100 \
--device-name "iPhone 12" \
--device-os-version "14.0"
```

Or you can specify the device name to target an eligible physical device:

```bash
portals serve ios device \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100 \
--device-name "Carl's iPhone 15"
```

#### Specify portal name

If you want to override only portals with a specific name, use the `--portal-name` flag:

```bash
portals serve ios [simulator | device] \
--application /path/to/your/ios.app \
--dev-server http://localhost:8100 \
--portal-name "profile"
```
### Flags:
- `--device-id` **(string)** The ID of the target device.
- `--device-name` **(string)** The name of the device. ('iPhone 13 Pro Max')
- `-h, --help` help for ios

### Global Flags:
- `--application` **(string)** Path to the native application. (required)
- `--dev-server` **(string)** URL of the development server. (required)
- `--capacitor-config` **(string)** Path to the capacitor configuration file.
- `--portal-name` **(string)** The name of the target Portal. (default "PORTAL")
- `--config` **(string)** config file (default $PWD/.portals.yaml)

2 changes: 1 addition & 1 deletion website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ module.exports = {
type: "category",
label: "Command Reference",
collapsed: true,
items: ["cli/commands/poc", "cli/commands/sync"],
items: ["cli/commands/poc", "cli/commands/sync", "cli/commands/serve-ios"],
},
],
},
Expand Down

0 comments on commit a04a0cc

Please sign in to comment.