Skype URI through adb, can't turn video on by default - adb

I am trying to start a video call on Skype using their URI API, but the video is turned off when the call starts.
They give a clear example how to use it:
skype:skype.test.user.1?call&video=true
I am using adb to send the command, so I am using the command:
adb shell am start -a android.intent.action.VIEW -d "skype:someuser?call&video=true"
This successfully initiates the call, but with video off. I have tried adding the extra parameter using the Android adb extra parameters:
--es extra_key extra_string_value
So my full command is
adb shell am start -a android.intent.action.VIEW --es "video" "true" -d skype:someuser?call
but this doesn't make the trick.

Figured out the solution thanks to this related answer.
The solution is simply to escape the ampersand (&) character inside the quotes!
So, the final command that worked for me is:
adb shell am start -a android.intent.action.VIEW -d "skype:someuser?call\&video=true"

Related

Adb Logcat to print only live traces

I am using following command which prints android device logs from connected device buffer in my desktop.
adb logcat
Now requirement is, i am running a test and want to see the output of current action in logs.
That is i need logs only since when i start logging command.
i don't want logs from the buffer or the logs prior to time when logging is started.
Also i don't want to clear the buffer using -c argument. because somebody (some other process) may need buffered traces during testing
adb logcat --live-trace
Thanks in advance for the help.
i found the perfect way to do it!
Read current time from the device only.
adb shell echo $(date +'%Y-%m-%d %H:%M:%S')
Merge the above output with ".000" (just adding milliseconds) and save into some variable say %timestamp%.
Then,
adb logcat -v threadtime - D -T %timestamp%
You can use it in one command:
adb logcat -v threadtime - D -T $(adb shell echo $(date +'%s')).000

Running a HTA file remotely using PSTools

Its almost certain that HTA files are obsolete, but i've found that they are much better than net send / msg.
I'm trying to run a HTA file on a remote machine using PSTools, but instead of it running, it brings back a broken window:
Running the HTA file using CMD (locally) works perfectly though.
My PsExec line:
PsExec.exe -accepteula -i -d \\itwall cmd 'mstha \\intranet\Downloads\VisitorSystemNewMessage.hta asd'
I even tried to run the HTA from a Batch file, but the exact same thing happens.
Any ideas?
It's because the account running the command cannot interact with the session of the remote user.
Use the -s switch to run the HTA using the system account of the remote computer.
Also, you shouldn't need to run cmd. You should be able to just specify mshta.exe then your arguments.
PsExec.exe -accepteula -s -i -d \\itwall mshta.exe \\intranet\Downloads\VisitorSystemNewMessage.hta asd
Edit: To illustrate that this is not an HTA issue. Run the following command:
PsExec.exe -accepteula -i -d \\itwall notepad.exe
Notice you'll have the same black window showing.

Android Things: take a screenshot

How do you take a screenshot via ADB for Android Things? I have tried:
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
and
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
I couldn't make screepcap work in Android Things Developer Preview. The command results in a 0-size file.
That said, I recommend the following two options: either use the framebuffer or record a video (screenrecord seems to work) and convert it to an image later on by proper tool. I'll consider the first option, so the steps would be:
Pull the framebuffer to the host machine. Note that you need to start adbd as root in order to pass a permission check:
adb root
adb pull /dev/graphics/fb0 screenshot
Convert the raw binary to image by the tool you prefer. I'm using ffmpeg. The command below might not work for you due to different screen resolution or pixel format. If so, make proper changes.
ffmpeg -f rawvideo -pix_fmt rgb565 -s 800x480 -i screenshot screenshot.png
Seems, because of old limited OpenGL version in Android Things, described by Tatsuhiko Arai here there is no possibility to get screenshot via ADB, but You can record video (e.g. from Android Studio, or via ADB commands) and than grab frame from it, for example via ffmpeg:
ffmpeg -i device-2017-01-23-193539.mp4 -r 1 screen-%04d.png
where device-2017-01-23-193539.mp4 - name of recorded (via Android Studio) file .
I've tried exactly this code with a little bit change like below (but no matter) and it works well. The image is in my platform-tools directory now.
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png screen.png
adb shell rm /sdcard/screen.png

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

Call command from exe in bat file

I am currently developing a android app and I am debugging wireless.
Every time I want to do this, I need to open the cmd in a specific direction and type:
adb
adb connect 'some ip'
adb is a exe and adb connect is some command in adb.exe
I was trying to write a simple bat file for this and I found this on the internet:
START C:\Andriod\adb.EXE
As you know, this only starts the adb.
I could not find how to call this command, propbably because I do not know the correct name for it. Can someone help me?
Use CALL command like this in batch:
#echo off
call C:\Andriod\adb.EXE
adb -s [yourdeviceserialnumberhere] shell
adb connect {ip:host}
http://www.droidforums.net/forum/android-hacks-help/6865-how-use-adb-all-commands-options.html

Resources