serve command is used to make the specified layouts available to the CTA for validation experiences.
Either provide a packaged touch adaptation bundle (that’s created with the pack command), or provide a set of layouts that aren’t packaged.
The following table shows the different options that are available for use with the serve command.
Security considerations
Theserve command is intended for local development. It temporarily hosts touch adaptation bundles from a development PC so a streaming client can load them during iteration. It shouldn’t be exposed to the public internet.
Use the narrowest host binding that fits your scenario:
- Use
--host localhostwhen only the local PC needs to connect. - Use
--host <specific IP address>when a streaming client needs to connect through one known local network interface. - Use
--host 0.0.0.0only when you intend to listen on every network interface on the development PC. Other devices on the same network might be able to reach the sideload server if firewall and network rules allow it.
localhost, use a shared or untrusted network, or need to leave the server reachable for longer than the current test pass. In those cases, prefer HTTPS by using --certificate-file with --certificate-password, as described in Certificate Generation Instructions. Add --password when you want to restrict client access to the served bundle.--password is used, choose or generate the value locally for the sideload session and enter the same value in the client’s developer settings. The password protects access to that local HTTPS sideload session; Microsoft doesn’t manage or rotate it for you. Rotate it by restarting tak serve with a new password and updating the client setting.
Examples
Use the following code example to serve a touch adaptation bundle on a host.Serve all the layouts in the layout-path on the default port and host and declare a specific version/version name
Serve a specified touch adaptation bundle only over localhost
Certificate Generation Instructions
A certificate is required to host an authenticated secure server for sideloading Touch Bundles. Any appropriate SSL certificate can be used, but the instructions below will create a certificate as well- Obtain the script to generate self-signed certificate from the XBOX Game Streaming Tools GitHub a. Navigate to the link above, select ‘raw’, and copy-paste the script contents into a document on your local machine b. Alternatively, run the following command in Powershell to download the script
The Create-SelfSignedCertificate.ps1 script only works on Windows. Tools may exist on other operating systems to generate valid self signed certificates
- Run the downloaded script in Powershell.
- The script will prompt you for a password to secure the certificate. Set the password by entering it here. This password will be used as input to the -certificate-password flag of the serve command.
This will generate two files:
sideload.pfxandsideload.cer. The path to thesideload.pfxcertificate file is to be passed as input to the -certificate-file flag of the serve command.
Trusting the certificate on different clients
Load the .cer file onto your device. This can be accomplished via e-mail, OneDrive, USB, ADB, AirDrop etc. Trust the certificate in the usual manner appropriate for the given device.Windows
- Double click the
sideload.cerfile - Select ‘Install Certificate’. This will open Certificate Import Wizard.
- Select ‘Current User’ as the Store location.
- In the next window, select ‘Place all certificates in the following store’ then select ‘Browse for Trusted Root Certification Authorities’.
Android
- On your Android device, navigate to Settings > Security > Advanced > Encryption & credentials > Install from Storage.
-
Install the certificate by selecting CA certificate and then browse for the
sideload.cerfile downloaded in the previous section Once installed, this certificate can be viewed under Trusted Credentials > User
iOS
- Navigate to the Files application on your iOS device to install the .cer file to your device profiles
- A new profile should be generated based on the .cer file profile name. This can be found under Settings > General > Profiles & Device Management.
- Install the certificate. The certificate signature should show as verified.
- To test the installed certificate, navigate to Settings > General > About > Certificate Trust Settings. Enable full trust for the root certificate that was just installed.
Examples
Use the following code example to serve a touch adaptation bundle on a host securely.Serve all layouts in the layout path on the default host and port over https
Serve all layouts in the layout path on the default host and port securely upon authenticating the client.
