i am using power shell programming to take a screen shot of android mobile and show in the gui of PC application that us built using power shell programming...
when screen capture button is clicked..it show error that sc.png does not exists
it means adb command is not capturing screen and save in sd cad....
$buttonTakeScreenCapture_Click={
.\adb.exe shell screencap -p > sc.png
.\adb.exe pull /sdcard/sc.png
Do not use redirection:
.\adb.exe shell screencap -p /sdcard/sc.png
.\adb.exe pull /sdcard/sc.png
Related
When I run my code in VS Code, I get this message after every user interface input
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
What can I do to use zsh and/or keep this messsage from appearing?
If you are using MAC, Apple has changed the default Interactive Shell from macOS Catalina.
But your Shell still could be bash.
if you want to change it to zsh, just run the following command in your terminal.
chsh -s /bin/zsh
and if you want to stop message appearing every time you open terminal
just follow this article here.
Here is what I am trying to achieve:
run a matlab command/script that starts a unix terminal and from within that terminal starts external software. Matlab itself should be decoupled from that shell immediately.
On a Unix system, I am currently trying to start an external program from within matlab. I know that I can basically use the matlab command prompt as a terminal by adding an ! in front of every command. However then, the program's output is also displayed within on the matlab command prompt and the program is killed as soon as matlab is closed.
To start an external terminal, call that terminal emulator using the matlab system command. If gnome-terminal is your terminal:
system('gnome-terminal');
To pass parameters to the terminal use -e
system('gnome-terminal -e echo hello World');
This terminal will close immediately after it's finished running. So too keep it open:
system('gnome-terminal -e "bash -c \"echo Hello World; exec bash\""');
Hope this helps. I similar command should work for other terminal emulators beside gnome-terminal.
I have been searching in google since one day and I have not found any information of how to resize the webbrowser window (for example, half of the screen) just starting the raspberry pi.
At the moment I achieved starting the webbrowser in kiosk with this code:
In /etc/xdg/lxsession/LXDE-pi/autostart
#xset s off
#xset -dpms
#xset s noblank
#epiphany-browser http://www.google.de
Any idea of how can give/configure a given size to the browser?
I solved by my own.
Just creating a script and using wmctrl in the script.
When starting the PC it run automatically this script.
#!/bin/bash
epiphany http://www.google.de &
sleep 15s
epiphany --new-window www.wikipedia.com &
sleep 15s
SOURCE=/usr/bin
echo "$SOURCE"
$SOURCE/wmctrl -r wikipedia -e 0,0,0,800,1080
$SOURCE/wmctrl -r Google -e 0,800,0,1120,1080
I'm looking for adb command to open settings and change them. For example: this command open display settings
adb shell am start -n com.android.settings/.DisplaySettings
I want to go further in menu to Display output mode then choose 720P 60HZ
As my menu is like this on android tv box:
Settings > Display > Display output Mode > HDMI 720P60HZ etc
Is there a adb command to do this go through settings then choose 720P60Hz directly with shell ?
Use this command to see a help on how you can use the settings adb shell command:
adb shell settings
Use get and put commands (after settings) to change the settings.
You will have to figure out the KEYs (use list) and acceptable VALUEs yourself (read documentation like https://developer.android.com/reference/android/provider/Settings.Global for the global NAMESPACE).
I'm not sure how to change the value directly, but to expand on another answer (and also because it sounds like this is what you're asking for), you can use adb to navigate through settings windows and pick different things in the UI. I've done that with some settings I can't seem to set a value from a single adb command. I just use the virtual Tab key to navigate through the menu items then press Enter to select a submenu or toggle an option.
I don't have an android tv box so I don't have the setting you do, but the commands would look something like this:
adb shell am start -a android.settings.DISPLAY_SETTINGS
adb shell input keyevent TAB
adb shell input keyevent TAB
adb shell input keyevent ENTER
adb shell input keyevent TAB
adb shell input keyevent TAB
adb shell input keyevent TAB
adb shell input keyevent TAB
adb shell input keyevent ENTER
adb shell am force-stop com.android.settings
You can try sending one tab command at a time to see how many you need to send before getting to the item you want.
Tips:
You can also use the Back button to go back a page:
adb shell input keyevent BACK
And you can use the arrow keys to navigate through confirmation popups (or move brightness/volume sliders):
adb shell input keyevent DPAD_RIGHT
adb shell input keyevent DPAD_LEFT
adb shell input keyevent DPAD_UP
adb shell input keyevent DPAD_DOWN
Here's a list of more key commands you can use (just look for the ones preceded by KEYCODE_, and remove that part. e.g. KEYCODE_BACK would be BACK as illustrated above):
https://developer.android.com/reference/android/view/KeyEvent
And here's a list of more direct settings windows you can launch:
https://stackoverflow.com/a/39873312
Copied here: (just precede them with adb shell am start -a to launch)
com.android.settings
com.android.settings.APPLICATION_DEVELOPMENT_SETTINGS
com.android.settings.DISPLAY_SETTINGS
com.android.settings.DOCK_SETTINGS
com.android.settings.QUICK_LAUNCH_SETTINGS
com.android.settings.SOUND_SETTINGS
com.android.settings.TTS_SETTINGS
com.android.settings.VOICE_INPUT_OUTPUT_SETTINGS
android.settings.ACCESSIBILITY_SETTINGS
android.settings.ACCOUNT_SYNC_SETTINGS
android.settings.ACCOUNT_SYNC_SETTINGS_ADD_ACCOUNT
android.settings.ADD_ACCOUNT_SETTINGS
android.settings.AIRPLANE_MODE_SETTINGS
android.settings.APN_SETTINGS
android.settings.APPLICATION_SETTINGS
android.settings.BLUETOOTH_SETTINGS
android.settings.DATA_ROAMING_SETTINGS
android.settings.DATE_SETTINGS
android.settings.DEVICE_INFO_SETTINGS
android.settings.DISPLAY_SETTINGS
android.settings.INPUT_METHOD_SETTINGS
android.settings.INTERNAL_STORAGE_SETTINGS
android.settings.LOCALE_SETTINGS
android.settings.LOCATION_SOURCE_SETTINGS
android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS
android.settings.MANAGE_APPLICATIONS_SETTINGS
android.settings.MEMORY_CARD_SETTINGS
android.settings.PRIVACY_SETTINGS
android.settings.SECURITY_SETTINGS
android.settings.SETTINGS
android.settings.SOUND_SETTINGS
android.settings.SYNC_SETTINGS
android.settings.SYSTEM_UPDATE_SETTINGS
android.settings.USER_DICTIONARY_SETTINGS
android.settings.WIFI_IP_SETTINGS
android.settings.WIFI_SETTINGS
android.settings.WIRELESS_SETTINGS
ACCESSIBILITY_FEEDBACK_SETTINGS
android.net.vpn.SETTINGS
android.search.action.SEARCH_SETTINGS
android.search.action.WEB_SEARCH_SETTINGS
As far as I know ther is no such functionality. However, you can use the
adb shell input tap <x> <y>
command to trigger a touch event. Unfortunately, such code will not work device-indepently as the position of your settings on the screen depends on the device you are using.
Alternatively you can try the
adb shell input keyevent <19|20|21|22>
command to emulate curser events to select the setting you want to alter.
Finally, you can use
adb shell input keyevent 66
to trigger the enter key. This should work on all devices having the same options in the settings submenu.
I need to emulate a key into a particular process running, i have no control about it's source code and Xserver isn't running, I believe the proc is using directfb to handle keyboard inputs.
You should be able to open a virtual terminal (fire a 'man 7 pty' to read the docs).
You can also run the app inside a detached screen and use the 'stuff' command to send input to the virtual window. Try it on the command line:
Start the application:
$ screen -S sessioname -d -m /path/command
Send input:
$ screen -S sessioname -X stuff 'input line 1
input line 2
...
input line n
'