Your question is ambigious. I understand it as you want to install apk as android app silently or it can also means you want to import automagic's flow silently too. I will answer both.
Silent install apk
To install apk without prompt, you need root. Use execute root command
Code: Select all
pm install -r /storage/emulated/0/Download/nameofyourapkhere.apk
-r is to replace. You might need option -d if you want to downgrade the version of the app. You can look at more available option at here :
http://adbshell.com/commands/adb-install
There is no way to bypass it without root access. Even if you can open the file using Start Activity via Package Installer, the installing process will block out all accessibility. It will also nag you if you overlay shown (widget overlay), preventing you from installing it. To tap the install, you can't use Control UI, but must use input x y (which need root). So essentially, root is needed for silent apk installation.
Auto "install" flow
To automatically import new downloaded flow, just use Action Import Flows/Widgets; point to the path of the xml flow. You might need to tick the Replace if you have the flow and want to update it to the latest version. After imported, every flow will be disabled (for safety reason). So if you are sure it is properly configured, you can use action Set Flow State and set that flow to enabled. Essentially auto import and enable the flow silently. You probably can couple this with some other trigger or as continuation from Action Download URL or maybe HTTP request Triggers.