We have moved to a new Sailfish OS Forum. Please start new discussions there.
16

[how to] start an app from terminal and collect log

asked 2015-08-06 21:08:32 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-08-08 11:17:20 +0200

pawel gravatar image

for all non-developers that have reported a bug and need to send a log to the corresponding developer

  • first enable developer mode to get the terminal application the option is in Settings\System in the Security section
  • start the terminal
  • type in name of application i.e. image description

this will start the application, the output will be shown on screen. You can make a screenshot: image description

;-)

to redirect the output into a file that you can collect, type instead

name_of_application >out.log 2>err.log i.e. [nemo@jolla ~]$ harbour-webpirate > out.log 2> err.log

to redirect stdout to a file, display stderr type:

name_of_application 1>file

to redirect stderr to a file, display stdout type:

name_of_application 2>file

to redirect both to a file, display nothing type:

name_of_application 1>file 2>&1 g

when done turn quit terminal, collect the file i.e. with Filebrowser and disable developer mode again

A small hint for TOHKBD owners: You'll love the tab key. It's auto-completion! So for the example screenshots it was enough to write ha[tab]we[tab] instead of harbour-webpirate. :-)

edit retag flag offensive close delete

Comments

Tried to make some screenshots for you, problem:

harbour-webpirate > out.log 2> err.log

doesn't work. stderr is still printed to screen and stdout to err.log - out.log is empty.

Also: "to redirect stdout to a file, display stderr type" - you can safely remove the 1, so it looks like name of application >file

Last: "name of application 1>file 2>&1 g" what exactly is the "g" for?

V10lator ( 2015-08-07 13:19:59 +0200 )edit
1

Remove the spaces after each >.

Giacomo Di Giacomo ( 2015-08-07 13:49:45 +0200 )edit

http://bfy.tw/1Bx6

chemist ( 2015-08-07 13:55:34 +0200 )edit

very funny indead. as a windows user my main problem was: where the hell is the app located? was surprised to find out that path is not needed rest is anyway 1:1 to windows

pawel ( 2015-08-07 14:13:39 +0200 )edit
1

@pawel A bit off topic but:

[nemo@Jolla ~]$ which harbour-webpirate 
/usr/bin/harbour-webpirate

;)

V10lator ( 2015-08-07 15:11:28 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2015-08-18 20:47:33 +0200

Kiratonin gravatar image

How to start an android app from terminal?

edit flag offensive delete publish link more

Comments

1

with apkd-launcher look into .desktop files in /usr/share/applications/

chemist ( 2015-08-18 21:01:21 +0200 )edit
0

answered 2018-02-13 20:04:21 +0200

Upp15 gravatar image

How about starting an app (like harbour-file-browser) as 'root' ?

edit flag offensive delete publish link more

Comments

Thanks!

I'll copy that also here:

  • Activate developer mode, set ssh password
  • SSH to your phone
  • devel-su
  • export XDG_RUNTIME_DIR=/run/user/100000
  • xdg-open /usr/share/applications/ble_scanner.desktop

Is the last one an example ? I don't have file like that in my phone !?

Upp15 ( 2018-02-14 07:37:34 +0200 )edit

The last line 'xdg-open.......' is an example. Inside folder '/usr/share/applications' are all your installed applications, so replace ble_scanner.desktop with; for example '/usr/share/applications/harbour-file-browser'.

I'm not sure how you would start an app as root, but I'm pretty sure Schturman has a patch for that!, have a look here on Openrepos; https://openrepos.net/content/schturman/patch-startasroot-file-browser

Spam Hunter ( 2018-02-14 12:50:04 +0200 )edit
Login/Signup to Answer

Question tools

Follow
8 followers

Stats

Asked: 2015-08-06 21:08:32 +0200

Seen: 2,483 times

Last updated: Feb 13 '18