Setup

adb (Android Debug Bridge) is the easiest way to install Snapdragon Spaces apps on Snapdragon Spaces devkits. 


While it should be clear how to connect an all in one devkit (e.g.: Think Reality VRX, Skyworth), for host and viewer combination devkits (e.g.: Think Reality A3, NTT QONOQ) connect to the phone. 


The documentation can be found on the Android Developer Portal at Android Debug Bridge (adb)  |  Android Studio  |  Android Developers.


The easiest ways to get adb


First time setup

  1. Enable the Developer Options. This is usually achieved by going into the Settings and tapping on the device's Build number several times. On all in one devices the Build number can usually be found in the Settings app as well. For a more detailed guide check out https://developer.android.com/studio/debug/dev-options#enable.
  2. Make sure that USB Debugging is enabled on the Snapdragon Spaces device. This setting can usually be found in the device's Settings app under Settings > System > Advanced > Developer Options > USB debugging. For more details check out https://developer.android.com/studio/debug/dev-options#Enable-debugging.
  3. Connect the Snapdragon Spaces devkit to a computer. A prompt will show up on the device asking to allow the USB debugging connection. Confirm this dialogue. Optionally check "Aways allow from this computer" to avoid having to confirm this dialogue again. 
  4. The device should be ready for running adb commands now. Try adb devices.


adb Wifi

adb Wifi allows to debug and use all benefits of an adb connection of a thethered connection via wifi. More detailed instructions can be found on the Android Developer Portal Android Debug Bridge (adb)  |  Android Studio  |  Android Developers.


A comprehensive step by step guide

  1. Be sure the device is plugged in and connected to the same wifi network as the computer.
  2. adb tcpip 5555 to set up wifi connectivity on the device
  3. adb shell ip addr show wlan0 provides the current IP address of the connected device. Take the first result if there are multiple. E.g.: 192.168.1.196. 
  4. Copy the IP address
  5. adb connect [IP address]:5555 to connect the device via wifi. 
  6. Unplug the device from the computer.
  7. Run adb devices to confirm that there is still a device connected.  


There are several applications that allow to do this via a graphical user interface. For example, Unity's logcat plugin Android Logcat | Android Logcat | 1.4.2 (unity3d.com or several plugins vor Rider, Visual Studio and Visual Studio Code.


Useful adb commands

Commonly used commands

adb commands are most easily run in the terminal (PowerShell) in the directory where the .apk is located. An easy way to do this on windows is to open the apk’s folder in the explorer, right clicking on an empty spot and selecting Open in Terminal.


adb command

Details

adb devices

Show a list of devices connected to this computer

adb install -r -g [path][name].apk

Installation of an application

-r reinstall; uninstall old install before installing this app

-g permissions; gives the app all requested permissions

[path] path to the apk folder location or nothing if the command line was opened in the apk folder location

[name] name of the apk on the computer

Example: adb install -r -g Unity/SnapdragonSpacesSamples_0.23.0.apk

adb uninstall [package identifier]Unistallation of an application
[package identifier] unique package identifier
Example: adb uninstall com.Qualcomm.SnapdragonSpacesSamples 



Advanced commands

adb commandDetails
adb shell
dumpsys package | awk '/^[ ]*Package \[.*\] (.*)/ { i = index($0, "[") + 1; pkg = substr($0, i, index($0, "]") - i); } /[ ]*versionName=/ { { print pkg "\t" substr($0, index($0, "=") + 1); pkg = ""; } }' | grep -i spaces
exit
This is a multiple line command providing a list of all applications package identifiers and versions installed on the device related to Snapdragon Spaces.
adb shell svc usb setFunctions mtpEnable Android file transfer


Logcat

logcat is used to capture debugging logs from a buffer on the device.


adb commandDetails
adb logcat -cClears the buffer
adb logcat > [path][filename].[format]Saves the log into a file
[path] path to the log folder location or nothing if the log should be saved in the path opened in the command line
[filename] name of the logfile
[format] format of the log file e.g.: txt, log
adb logcat -c && adb logcat > [path][filename].[format]Clears the buffer and then saves all following logs after the clearing into the specified file