I have used various adb shell commands to automate the loading of a URL to a handset via adb. It loads up the page but I need to then select an image on the screen. I have tried adb shell input keyevents but this is sometimes missing the image so I need to use the send event and mimic the touching of the screen.
Can someone please help. How do I find out the co-ordinates of the picture?
Thanks
You can use monkeyrunner to get screenshot
import sys
import os
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection(10 , os.getenv('ANDROID_SERIAL'));
image = device.takeSnapshot();
image.writeToFile("/folder/test.png","png");
Don't forget to SET on windows and EXPORT on Linux ANDROID_SERIAL
ANDROID_SERIAL - it's your device number (can be obtain by using adb devices)
Then open image in Paint or any other, and get the coordinates of picture.
Enable Show pointer location from developer options. It will show coordinates of the point where you touch. using the coordinates you can touch on required points using monkeyrunner or
adb shell input tap <x><y>
.
Related
I am automating a test for an Android TV Box in which it is required to type out the name of certain VOD asset to watch. I am using adb shell input text <string> for that and it's working beautifully.
The issue comes when I try to input a number, the device considers it as if I'm changing channels, and it exits my search whenever I send a number. Does anyone know how to go around that?
Edit: the product owner confirmed that sending integers as text without having the box interpreting them as channel change is inevitable, and so I should close this question.
Currently there doesn't seem to be an easy way to copy/paste text in the Oculus Quest, nor to 'type' into a companion app and have it sent into the headset (at least that I have seen). This makes it extremely challenging to enter complex passwords from password managers, etc.
I have read some articles that say it might be possible to pair a bluetooth keyboard with the headset, which would be slightly better, but still doesn't allow me to copy/paste from my password manager.
Does anyone know of a way to achieve this?
After some Googling/SO'ing, it seems like this might be possible using the Android Debug Bridge (adb) (Oculus has their own help page for it as well)
Your device needs to be in developer mode for this to work:
Create/join an organisation in the Oculus Dashboard
Open the Oculus app on your mobile phone.
In the Settings menu, select the Oculus Quest headset that you’re using for development.
Select More Settings.
Toggle Developer Mode on.
If you're using homebrew on macOS, you can install adb with:
brew cask install android-platform-tools
Next, plug your headset into your computer with the USB-C cable. You then should be able to list connected devices:
adb devices
If it says 'unauthorized', check in the headset for a dialog box asking for permission to connect. Ticking 'always allow' will make this easier in future.
At this point, we should be good to send text to the device. In the headset, focus a field that you want to 'type' into, then use adb shell input to 'type' your text:
adb shell input text "sometext"
It seems it is also possible to send a 'paste' command using adb shell input keyevent:
adb shell input keyevent 279
In older Android devices, you could send a 'copy' command in a similar way, but this has since been deprecated:
service call clipboard 2 i32 1 i32 0 s16 "text"
It seems that on newer devices, you need to leverage an external service (eg. Clipper) to 'copy to clipboard'. Using Clipper, you can send a command in adb shell such as:
am broadcast -a clipper.set -e text "text"
There are many different inputs we can send using these methods. You can find a full list of KeyEvent's in the Android Developer Documentation.
Using one (or more) of these methods, it should be possibly to 'copy'/'paste'/'type' passwords stored in a password manager on your computer 'into' the Oculus Quest headset.
I am using Putty in Cmder to ssh to a 'jumpbox'. I then pass a hostname in a file using the -m ssh option to jump to the 'real' destination host.
I want to dynamically set the title of the putty tab from within a task definition in Cmder/ConEmu to be the hostname I'm jumping to. In the screenshot below you can see that I have attempted to use "%REMOTE_HOST%" to pass in an environment variable containing the title that I want to have on my tab. However this just creates a tab named %REMOTE_HOST%.
Any help would be greatly appreciated.
I explained many times that PuTTY and mintty are not console applications, they are GUI applications with their own graphical interface.
An analogy: you run VirtualBox with Ubuntu (as client) in Windows (as host) and some console application in you VirtualBox-ed Ubuntu. Don't you wonder why TaskBar in Windows does not show the title of Ubuntu console?
When you run ChildGUI in ConEmu it shows in the Tab children window title.
What you need to do
Configure PuTTY or your remote host (e.g. bash prompt with ANSI) to show proper text in PuTTY title. The questsion has nothing to do with ConEmu.
Also, ensure that the tab bar console template in ConEmu/Cmder settings is or contains %s. e.g.
I manage a small project where I occasionally distribute a different version of a google glass application to some (4) google glass devices manually through the adb shell. One version of the package is used for each google glass, and it depends on which gmail address the glass uses. (they all look the same)
Usually I would have to turn on the glass to see, but I was looking for a method of getting the gmail address associated with the glass through the adb shell. Is this possible?
Thank you.
There is no way I know to retrieve such info about the user.
But, you can simply put a file in the external storage containing the email account once, and then query this file when you want:
# write the user info
adb shell "echo \"xyz#gmail.com\" > /sdcard/user.info"
# get the user info
adb shell cat /sdcard/user.info
If you want this info without turning the glass on, you'll have to print a note directly on the glass ;)
Using the adb command, one way to differentiate each Glass device is through their serial numbers. You can then choose which device to install on by running the following command:
adb -s <serial number> install <apk name>.apk
I installed a launcher (syndicateapps ICS 4.0) on my rooted Kindle Fire; like an idiot I ticked 'Set to Default' only to get "The application ICS 4.0 Launcher (process android.process.acore) has stopped unexpectedly".
Force close just loops round to the same screen.
I can access my KF with adb but haven't able to find the file I need to edit which will remove the default.
Advice appreciated.
I had the same issue... here is a solution using a windows machine.
Refer to this link and the back links in the video description to setup the Kindle Fire Utility.
Once installed -- if not already, open kindle Fire Utility folder, you should see a file called 'run' inside. Double click on that file, you should see a command prompt window display.
Type in '7' for going into the 'Extras' options.
From there type in '2' which "Installs Google Apps / Go Launcher.
Once all the packages are installed you will gain access to your home screen to remove the launcher you have and use your fire again.