devscript: support -t opt in list_running_app_ids

and refactor