# Tasker how to tell if app is frozen using shell commands



## skatastic (Aug 30, 2011)

Mod Type:: Application

Difficulty:: Difficult

Mod Status:: Alpha

Apply In:: Other (See Description)

Requires Root:: Yes

Source:: 
I have a few apps that needlessly leave services running even when the app is not in use. For those apps I have tasker freeze (disable via secure settings) them whenever the screen goes off. I have separate tasks for each that unfreezes them, waits 1 sec, and then loads the app. The problem is that it takes an indeterminate amount of time to unfreeze them such that most of the time the 1 sec isn't enough. I could change it to be a 3-5 sec wait but that isn't ideal. Currently I just tap twice to get those apps up. Anyway, it seems like there should be a way to have it wait until the app is unfrozen before it tries to unload it. I realize this might take some shell commands but might as well get my hands dirty.

Things I need to know:
what shell command can I use to determine if an app is frozen?
how to use the wait until function in tasker?


----------



## skatastic (Aug 30, 2011)

I actually figured out how to do this if anyone is interested let me know I'll post it


----------



## yarly (Jun 22, 2011)

Please post app questions in the General Android forum. The application forum is for developers to post their applications.

Thank you.

Also to answer your question, use package manger in the android terminal/adb shell:


```
<br />
pm usage: pm [list|path|install|uninstall]<br />
	   pm list packages [-f]<br />
	   pm list permission-groups<br />
	   pm list permissions [-g] [-f] [-d] [-u] [GROUP]<br />
	   pm list instrumentation [-f] [TARGET-PACKAGE]<br />
	   pm list features<br />
	   pm path PACKAGE<br />
	   pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH<br />
	   pm uninstall [-k] PACKAGE<br />
	   pm enable PACKAGE_OR_COMPONENT<br />
	   pm disable PACKAGE_OR_COMPONENT<br />
	   pm setInstallLocation [0/auto] [1/internal] [2/external]<br />
<br />
The list packages command prints all packages.  Options:<br />
  -f: see their associated file.<br />
<br />
The list permission-groups command prints all known<br />
permission groups.<br />
<br />
The list permissions command prints all known<br />
permissions, optionally only those in GROUP.  Options:<br />
  -g: organize by group.<br />
  -f: print all information.<br />
  -s: short summary.<br />
  -d: only list dangerous permissions.<br />
  -u: list only the permissions users will see.<br />
<br />
The list instrumentation command prints all instrumentations,<br />
or only those that target a specified package.  Options:<br />
  -f: see their associated file.<br />
<br />
The list features command prints all features of the system.<br />
<br />
The path command prints the path to the .apk of a package.<br />
<br />
The install command installs a package to the system.  Options:<br />
  -l: install the package with FORWARD_LOCK.<br />
  -r: reinstall an exisiting app, keeping its data.<br />
  -t: allow test .apks to be installed.<br />
  -i: specify the installer package name.<br />
  -s: install package on sdcard.<br />
  -f: install package on internal flash.<br />
<br />
The uninstall command removes a package from the system. Options:<br />
  -k: keep the data and cache directories around.<br />
after the package removal.<br />
<br />
The enable and disable commands change the enabled state of<br />
a given package or component (written as "package/class").<br />
<br />
The getInstallLocation command gets the current install location<br />
  0 [auto]: Let system decide the best location<br />
  1 [internal]: Install on internal device storage<br />
  2 [external]: Install on external media<br />
<br />
The setInstallLocation command changes the default install location<br />
  0 [auto]: Let system decide the best location<br />
  1 [internal]: Install on internal device storage<br />
  2 [external]: Install on external media<br />
```


----------



## skatastic (Aug 30, 2011)

Here's the task in tasker I use to launch facebook from a freezed (disabled) state 
1. Run shell: pm list packages -d facebook (store result in %FBK)
2. goto 6 (if %FBK !~ package.com.facebook.katana)
3. Secure Settings enable facebook
4. Wait 10MS
5. Goto 1
6. Load app facebook

Export to individual app and then use that to launch the app

I have another tasker process that when the screen is turned off it uses secure settings to disable apps


----------

