How to use ADB to change the virtual enviroment on Oculus Quest 2 - adb

I want to be able to switch the VR (oculus quest 2) virtual environment from my computer to control the environment the user is seeing. I believe that ADB commands is the likely solution.
The only command I can find to change the activity is
adb -s _MQDH_CONNECTED_DEVICE_SERIAL_ID_ shell am start -n com.oculus.shellenv/.ShellEnvActivity
However, this command is just a general command to go to the home screen. Is there a way to modify this to change the virtual environment

Related

log in adb shell "interactive mode" and "non-interactive mode"

I'm writing script to run iperf on linux device accessible via adb.
From a terminal, when I run the command: adb shell iperf -c ......
I get the log of the command 50 s after the command starting.
inconvenient: during 50 s you are not sure that iperf has started
I tried the logcat command (logcat --pid ...), It gives the same result.
From a terminal, when I enter adb session first and then I run the command: iperf -c .....
I get the log of the command in real time.
inconvenient: I'm not able to automate the procedure, because I have to start the adb session first
For the first use case: Is there a way to force "log flush" in order to get the log in real time?
For the second use case: Is there a way to send commands to already opened adb shell session?
Is there any other ways to launch iperf on device and get the log in real time?
The solution i found is the library pexpect that allow to interact with adb session.

I need an adb command to enable an android accesibility option

I'm trying to start voice access but the phone I'm using doesn't have the accessibility menu is there a direct adb command to get it started?
To start the accessibility service you can use:
adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
And to stop:
adb shell am force-stop com.google.android.marvin.talkback
NEW_SERVICE can be enabled by
adb shell settings put secure enabled_accessibility_services NEW_SERVICE
However, this can also disable all OTHER_ENABLED_SERVICES. So It's better to use
adb shell settings put secure enabled_accessibility_services OTHER_ENABLED_SERVICES:NEW_SERVICE
Here we use : to join services. The content of OTHER_ENABLED_SERVICES can be known using
adb shell settings get secure enabled_accessibility_services
The content of NEW_SERVICE can be extracted from the result too, if you turn on the service maually.
NEW_SERVICES can be disabled using
adb shell settings put secure enabled_accessibility_services OTHER_ENABLED_SERVICES

How to get vscode-remote-ssh extension connects via git bash in windows?

I have vs code configured to use the git bash as a terminal in windows 7.
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"
I have enabled SSH key based authentication to remotely access a host. All this works fine from within the terminal in VS Code.
However, when using the vscode-remote SSH extension to connect to host I get an error because it tries to connect using "The terminal process command 'cmd.exe'" instead of git bash.
I've checked my terminal settings configuration in vs code and it points to git bash.exe
I've used the terminal extension in vs code and it opens a git bash and successfully connects to the host
Is there a setting that I'm missing to force Remote-SSH to use the git bash for the connection?
JerryL's answer lead me to realize, that I can simply set GIT's ssh path c:\Program Files\Git\usr\bin\ssh.exe in the remote.SSH.path setting of VS Code Preferences:
Then it just worked like a charm.
Just for clarity my VS Code version is: 1.40.0-insider (system setup)
I ran into a similar issue trying to get MS VS Code Studio Remote-SSH working with Putty's Pageant. I had Git for Windows installed and in a Git Bash shell, I could ssh and pick up the Pageant keys and no password was needed.
But VS Code Remote-SSH, while using the Git ssh in C:\Program Files\Git\usr\bin\ssh.exe was using Windows 7 cmd.exe shell which didn't talk to Pageant.
What worked for me on Windows 7, VS Code 1.36.1 with (Remote Development 0.15.0, Remote-SSH 0.44.0) and Git for Windows 2.22:
Start Pageant (C:\Program Files\PuTTY\pageant.exe) and Add key.
Start the ssh agent shim (C:\Program Files\Git\cmd\start-ssh-pageant.cmd). This takes care of the communication between Git ssh, which looks for ssh-agent, and Pageant.
Create the SSH_AUTH_SOCK environment variable
Control Panel / System / Advanced Settings / Environment Variables..
User variables for username / New..:
Variable name: SSH_AUTH_SOCK
Variable value: /tmp/.ssh-pageant-username (e.g. /tmp/.ssh-pageant-bill) (Environment Variable assignment screenshot)
Test ssh:
Open a command prompt: Enter set to view the list of Environment Variables. Is the SSH_AUTH_SOCK variable set correctly to something like /tmp/.ssh-pageant-bill?
Try ssh to your host using Git's ssh.exe: c:\Program Files\Git\usr\bin\ssh.exe user#host If this works, then VS Code Remote-SSH should work.
Finally, I added Pageant and start-ssh-pageant.cmd to my Windows 7 Startup so this persists across reboots.
Hope that helps.
Jerry.
I had a similar problem trying to get VS Code Remote use Putty Pageant.
1. Create .bat file somewhere with the following content:
echo OpenSSH
"C:\YOUR_PATH_HERE\PLINK.EXE" -ssh %*
2. Open VS Code settings, type remote ssh path in search and find Remote.SSH: Path settings
3. Past here path to your .bat file
4. Now VS Code Remote will use Pageant correctly.

windows, Putty, pscp combined in to a single batch file, is it possible?

I'm having trouble getting an answer to my question, in laymens terms. It is probably my lack of knowledge on the subject so, I'm dumbing down the question. I have a windows machine that I run the putty tool from and connect to a linux box. I run " killall /bob/bin/myfile.out " then close putty then type in a cmd prompt pscp.exe myfilet.out.2.3.4 root#192.168.1.1:/bob/bin/myfile.out . Can someone show me how to combine these into a single windows batch file? thank you
You could use the free command line tool Plink to run commands on external servers via SSH.
#echo off
Plink root#192.168.1.1 "killall /bob/bin/myfile.out"
pscp.exe myfilet.out.2.3.4 root#192.168.1.1:/bob/bin/myfile.out || echo an error occurred when copying the file.
the command after || on the second line will only run if an error level is set by the previous command.
I can't add comments yet, but can you elaborate on how you login with putty, but not do the exact same thing with plink? Plink not only accepts all the same options as putty, but if you have a saved session in putty, you can access it from plink. Without any subcommands, plink should essentially make you CMD shell look like a crude putty window, with subcommands, it will execute them and return:
C:\Users\riglerjo>plink savedputtysession
Using username "rigler".
# hostname
s9-chicago.accountservergroup.com
-bash-3.2$ exit
logout
Run the remote command as an option on plink:
C:\Users\riglerjo>plink savedputtysession hostname
s9-chicago.accountservergroup.com

Windows: script/program for USB key that opens a console, and sets the path and the working directory

The goal behind this question is to create a portable Windows script/program that would help users run (console) programs directly from a USB key (not necessarily through autorun, though). The script/program would thus do the following when double clicked on:
Launch a console (cmd would do) and give a DOS command prompt,
Have the current directory set to a specific directory WorkingDir on the USB key (which contains various [Python] programs),
Set the path so that the user can run a command (python.exe) found in another USB key directory (so that the user can launch various Python programs found in WorkingDir).
The whole thing is based on Portable Python, which is on the USB key. I would also like to be able to simply put the contents of the key on a hard drive and use it from there.
I tried to write a file that contains commands like:
PATH=..\"Portable Python 2.7.2.1\App":%PATH%
cd WorkingDir
cmd
but I'm not sure how to call it so that Windows runs it (and I was therefore not able to see whether these command would work).
I don't know much about DOS and Windows, so any help would be much appreciated!
Actually, in windows you use ; for separating paths :) And you shouldn't use .. like that. You can use %CD% to get current directory and then navigate from it. And don't use quotes. Also, you could put # before any command that you don't wish to be echoed to the console.
You can put this into run.bat (this should work :P):
#PATH=%PATH%;%CD%\..\Portable Python 2.7.2.1\App
#cd WorkingDir
#cmd
And then just double click it and it will open commmand prompt just as you want it. Or maybe you can add autorun.inf file to open it automatically.
You need to create two files:
autorun.inf
[autorun]
open=cmd.exe "Python Console" /k autorun.cmd
action=Open Python Console...
autorun.cmd
#Echo Off
CD %~d0\WorkingDir
Path %Path%;%~d0\Portable Python 2.7.2.1\App
The phrase %~d0 represents the drive the command file resides, namely the flash drive's letter (E:).
Now, I encountered two slight hiccups. My USB drive had a hidden, system, readonly autorun.inf file on it already. I had to unprotect it with the following command before I could edit it.
Attrib autorun.inf -r -s -h
My second hiccup, is that Windows 7 won't autorun from a USB drive. You have to right-click the drive in Explorer and select "Run Python Console..."

Resources