HamidZaeri Posted April 8, 2018 Share Posted April 8, 2018 Hi When I run this adb command via CMD: adb shell "dumpsys window windows | grep -E 'mFocusedApp'| cut -d / -f 1 | cut -d ' ' -f 7" I get the output (The Package name of running app on android device) But when I use it in autoit as below: Local $appfor = RunWait($adbpath & " shell "&'"'&"dumpsys window windows | grep -E "&"'"&"mFocusedApp"&"'"&"| cut -d / -f 1 | cut -d "&"'"&" "&"'"&" -f 7"&'"',@TempDir,@SW_HIDE) ClipPut($appfor) I get "0" in the clipboard! What's wrong with my code? Link to comment Share on other sites More sharing options...
Danyfirex Posted April 8, 2018 Share Posted April 8, 2018 Hello. RunWait Return the procress Exit Code. check StdoutRead and StderrRead in help file. Saludos HamidZaeri 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
HamidZaeri Posted April 8, 2018 Author Share Posted April 8, 2018 (edited) 1 hour ago, Danyfirex said: Hello. RunWait Return the procress Exit Code. check StdoutRead and StderrRead in help file. Saludos I did this?! #include <AutoItConstants.au3> $appfor = RunWait($adbpath & " shell "&'"'&"dumpsys window windows | grep -E "&"'"&"mFocusedApp"&"'"&"| cut -d / -f 1 | cut -d "&"'"&" "&"'"&" -f 7"&'"',@TempDir,@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) $Mes = StdoutRead($appfor) ClipPut($Mes) But nothing in the clipboard! Would you please fix my code? Edit: I think I managed it! (changed RunWait to Run) $appfor = Run($adbpath & " -s " & $winfo[1] & " shell "&'"'&"dumpsys window windows | grep -E "&"'"&"mFocusedApp"&"'"&"| cut -d / -f 1 | cut -d "&"'"&" "&"'"&" -f 7"&'"',@TempDir,@SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) $sOutput = '' While 1 $sOutput &= StdoutRead($appfor) If @error Then ExitLoop EndIf WEnd ClipPut(StringTrimRight($sOutput,3)) Edited April 8, 2018 by HamidZaeri Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now