You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/engine/overview.md
+14-33Lines changed: 14 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,41 +104,22 @@ See documentation on the [Camera Pipeline Module API](/docs/api/engine/camerapip
104
104
105
105
### Test on Mobile
106
106
107
-
To test your project on mobile devices, especially for AR experiences that require camera access, you'll need to serve your development server over HTTPS.
107
+
To test your project on mobile devices, especially for AR experiences that require camera access, you'll need to serve your development server over HTTPS. We recommend using [ngrok](https://ngrok.com/) to create a secure tunnel to your local server.
108
108
109
-
1. If you do not already have `npm` installed, follow the instructions on this [page](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to set it up.
110
-
2. Run `npm install --global http-server` to install the [http-server](https://www.npmjs.com/package/http-server) npm package as a global CLI tool.
111
-
3. Install [openssl](https://github.com/openssl/openssl) and generate key.pem and cert.pem files using this command:
You will be prompted with a few questions after entering the command. Use `127.0.0.1` as value for Common name if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted.
117
-
118
-
This generates a cert-key pair and it will be valid for 3650 days (about 10 years).
119
-
120
-
Then you can run `http-server` with `-S` for enabling SSL and `-C` for your certificate file:
1. Go to [ngrok.com](https://ngrok.com/) and create an account. Once signed in, follow the steps on the dashboard to install ngrok.
110
+
2. Update (or verify) your project configuration. In the `config` folder, open `webpack.config.js` and look for the `devServer` object. Add (or verify) ngrok as an `allowedHost`:
111
+
```javascript
112
+
devServer: {
113
+
// ... existing config
114
+
allowedHosts: ['.ngrok-free.dev']
115
+
}
128
116
```
129
-
130
-
There should be some logs that list a series of local URLs like:
131
-
```sh
132
-
Available on:
133
-
http://127.0.0.1:8080
134
-
http://192.168.20.43:8080
135
-
http://172.29.29.159:8080
117
+
3.`cd` to the project root and run `npm install`. Run `npm run serve` to run the local development server.
118
+
4. Open a seperate terminal window and run the following command (in most cases, `[port]` will be `8080`)
119
+
```bash
120
+
ngrok http [port]
136
121
```
137
122
138
-
:::note
139
-
The first IP address listed is `127.0.0.1:8080` (which is the loopback device aka "localhost") and your mobile phone won't be able to connect to that IP address directly. Please use one of the other IP addresses.
140
-
:::
141
-
142
-
Window users need to run the http-server command using a standard Command Prompt window (cmd.exe). The script may generate errors if run from PowerShell.
123
+
In the output you should see an ngrok URL that uses HTTPS and forwards to your local development server. You can paste this into your browser window and test your project on a mobile device.
143
124
144
-
Learn more in the [http-server documentation](https://github.com/http-party/http-server#tlsssl).
Copy file name to clipboardExpand all lines: docs/getting-started/testing.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,28 @@ sidebar_position: 6
16
16
17
17
To test your project on mobile devices, especially for AR experiences that require camera access, you'll need to serve your development server over HTTPS. We recommend using [ngrok](https://ngrok.com/) to create a secure tunnel to your local server.
18
18
19
-
After setting up ngrok, add the following configuration to `config/webpack.config.js` under the `devServer` section:
20
-
19
+
1. Go to [ngrok.com](https://ngrok.com/) and create an account. Once signed in, follow the steps on the dashboard to install ngrok.
20
+
2. Update (or verify) your project configuration. In the `config` folder, open `webpack.config.js` and look for the `devServer` object. Add (or verify) ngrok as an `allowedHost`:
21
21
```javascript
22
22
devServer: {
23
23
// ... existing config
24
24
allowedHosts: ['.ngrok-free.dev']
25
25
}
26
26
```
27
+
3. Relaunch the desktop app or exit/reopen the project to refresh the build after updating the webpack configuration
28
+
4. Open the Simulator/Preview and click the browser pop-out button
4. Open a terminal window and run the following command, replacing [port] with the port obtained from the simulator browser pop-out
37
+
```bash
38
+
ngrok http [port]
39
+
```
40
+
41
+
In the output you should see an ngrok URL that uses HTTPS and forwards to your local development server. You can paste this into your browser window and test your project on a mobile device.
0 commit comments