Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

ADB command cheat sheet

Daosheng Mu edited this page Apr 25, 2020 · 26 revisions

Important Note

The applicationId for Firefox Reality is:

  • For most platforms: org.mozilla.vrbrowser.
  • For WaveVR non-store builds: org.mozilla.vrbrowser.wavevr.
  • For developer builds: org.mozilla.vrbrowser.dev.

In case you are using a different applicationId, replace org.mozilla.vrbrowser in the examples below with the corresponding applicationId.

Install

adb install /path/to/your.apk

Uninstall

adb uninstall org.mozilla.vrbrowser
  • List all instances of Firefox Reality installed on a device:
adb shell 'pm list packages -f' | grep org.mozilla.vrbrowser

Update

adb install -r /path/to/your.apk

Stop

adb shell am force-stop org.mozilla.vrbrowser

Launch

adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity

or

adb shell am start -a android.intent.action.LAUNCH org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity
  • Loading a URL

There are different ways Firefox Reality can be started loading a specific URL:

adb shell am start -a android.intent.action.VIEW -d "https://example.com" 
adb shell am start -a android.intent.action.VIEW org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity -d "http://mozilla.org"
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity "https://example.com" 
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity -d "https://example.com" 
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity -e url "https://example.com" 
  • Overriding the homepage
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity -e homepage "http://newhomepage"
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez e10s true
  • Open a URL in a new window
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez create_new_window true "https://example.com"
  • Open a URL in a new foreground tab
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez create_new_tab true "https://example.com"
  • Open a URL in a new background tab
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez create_new_tab true --ez background true "https://example.com"
  • Hide WebXR Interstitial widget
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez hide_webxr_interstitial true
  • Hide What's New widget
adb shell am start -n org.mozilla.vrbrowser/org.mozilla.vrbrowser.VRBrowserActivity --ez hide_whats_new true

Kill the content process

  • Linux/MacOs
adb shell ps | grep vrbrowser:tab | awk '{ print $2 }' | xargs adb shell run-as org.mozilla.vrbrowser kill
  • Windows Powershell
adb shell ps | Select-String -Pattern "vrbrowser:tab" | %{($_ -split "\s+")[1]} | %{(adb shell run-as org.mozilla.vrbrowser kill $_)}

Screen recording

ADB

  • Screen recording settings
adb shell setprop debug.oculus.videoResolution 1440 && adb shell setprop 
  • Start recording
adb shell setprop debug.oculus.enableVideoCapture 1
  • Stop recording
adb shell setprop debug.oculus.enableVideoCapture 0
  • Pull recorded videos
adb pull /sdcard/oculus/VideoShots/ ./

Note: You can also record videos on the Oculus Go by exiting to the system library, and from the Oculus tray menu (toggle with the Oculus button on the controller): Sharing > Record Video

Screen recording (All platforms)

  • Screen recording (two-eyes)
adb shell screenrecord /sdcard/demo.mp4
  • Parameters
Parameter Value Description
--size WIDTHxHEIGHT Sets the video size. The default value is the device's native display resolution (if supported), 1280x720 if not. For best results, use a size supported by your device's Advanced Video Coding (AVC) encoder.
--bit-rate RATE Sets the video bit rate for the video, in megabits per second. The default value is 4Mbps. You can increase the bit rate to improve video quality, but doing so results in larger movie files. The following example sets the recording bit rate to 5Mbps: adb shell screenrecord --bit-rate 5000000 /sdcard/demo.mp4
--time-limit TIME Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes).
--rotate Rotates the output 90 degrees. This feature is experimental.
--verbose Displays log information on the command-line screen. If you do not set this option, the utility does not display any information while running.
  • Pull recorded videos
adb pull /sdcard/demo.mp4 ./

Oculus Only (single-eye)

Follow this guide to take a single-eye video from inside the app:

https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-testing-capture/

Once the recording has been stopped, you can get all the recorded videos doing:

adb pull /sdcard/Oculus/VideoShots ~/Downloads/

Screen capture (All platforms)

  • Capture screen
adb shell screencap -p /sdcard/screencap.png
  • Pull captured screenshot
adb pull /sdcard/screencap.png ./

Oculus Only (single-eye)

Follow this guide to take a single-eye screenshot from inside the app:

https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-testing-capture/

Once the recording has been stopped, you can get all the recorded videos doing:

adb pull /sdcard/Oculus/ScreenShots ~/Downloads/

Clone this wiki locally