Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: ph_run1() - V2.2 new function Post ReplyPost New Topic
Message << Prev Topic | Next Topic >>
Super User
Super User

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 722
Posted: July 11 2020 at 16:55 | IP Logged Quote smarty

So happy to see a new ph_run1() function
that should allow for hiding pop up windows when
running commands from within PH.

Because the new FireTV plugin that comes with PH
doesn't provide any feedback for triggers, I am
looking into developing my own solutions (having ADB
write to a text file and having PH file monitor
trigger off that)...Anyway...that is another story.

What I am trying to accomplish presently is to run
ADB commands from PH without a pop up window.

Home Command:
ph_run("c:\adb\adb.exe shell input keyevent 3")

Launch Netflix:
ph_run("adb shell monkey -p 1")

Launch HDHomeRun:
ph_run("c:\adb\adb.exe shell monkey -p
com.silicondust.view 1")

Ect, Etc,...

Without a command window flashing on the screen as the
command executes.

Dave - I think I have tried almost every variation on
the ph_run1() command. Any insight you could provide

One last one...this is how I see which application is
on screen:
ph_run("adb shell dumpsys window windows

The above command (which outputs a text file for the
file monitor) works in a CMD window, but not from
within PH.

Edited by smarty - July 11 2020 at 17:58

Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
Admin Group
Admin Group

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4399
Posted: July 11 2020 at 22:10 | IP Logged Quote dhoward


You've got a couple of options listed below. Both will run ADB without opening a window.

Without Shell Execute:


With Shell Execute:


The following worked for me to run ADB without a window and redirect output to a file:

ph_run1('cmd.exe','/c "adb shell dumpsys window windows>ADB_windows1.txt"','c:\android_sdk',10000,72)


ph_run1('cmd.exe','/c "adb shell dumpsys window windows>ADB_windows1.txt"','c:\android_sdk',10000,84)

and another where I redirect the file output to a different directory:

ph_run1('cmd.exe','/c "c:\android_sdk\adb.exe shell dumpsys window windows>adb_windows1.txt"','c:\users\hello there\desktop',10000,84)

Out of curiosity, what kind of triggers would you like to be fired for the FireTV plugin? It might be simple enough for me to add.

Hope this helps,


Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum