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
- Download and install the Android Platform tools SDK Platform Tools release notes | Android Studio | Android Developers and add the adb file location to the environment variables. (A restart of the computer may be necessary afterwards).
- Download and install Android Studio Download Android Studio & App Tools - Android Developers and add the Android SDK Platform Tools package via SDK manager.
First time setup
- 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.
- 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.
- 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.
- 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
- Be sure the device is plugged in and connected to the same wifi network as the computer.
- adb tcpip 5555 to set up wifi connectivity on the device
- 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.
- Copy the IP address
- adb connect [IP address]:5555 to connect the device via wifi.
- Unplug the device from the computer.
- 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 command | Details |
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 mtp | Enable Android file transfer |
Logcat
logcat is used to capture debugging logs from a buffer on the device.
adb command | Details |
adb logcat -c | Clears 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 |