debugtron icon indicating copy to clipboard operation
debugtron copied to clipboard

Linux support

Open SoulMelody opened this issue 5 years ago • 12 comments

I tried to install and run debugtron on linux, but with no luck. Here is the backtrace:

debugtron /opt/github-desktop/github-desktop
internal/validators.js:125
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at normalizeSpawnArguments (child_process.js:416:3)
    at spawn (child_process.js:555:16)
    at startDebugging (/usr/lib/node_modules/debugtron/lib/index.js:76:14)
    at Command.program.version.arguments.action.appPath (/usr/lib/node_modules/debugtron/lib/cli.js:11:7)
    at Command.listener (/usr/lib/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:193:13)
    at Command.parseArgs (/usr/lib/node_modules/commander/index.js:653:12)
    at Command.parse (/usr/lib/node_modules/commander/index.js:474:21)
    at Object.<anonymous> (/usr/lib/node_modules/debugtron/lib/cli.js:17:4)

SoulMelody avatar Jun 29 '19 13:06 SoulMelody

I have managed to make it work with the following patch applied:

diff index.js index.js.bak

30,31d29
<     case 'linux':
<       return readdirAbsolute('/opt')
58,61d55
<     case 'linux':
<       return fs.existsSync(
<         path.join(appPath, 'resources/electron.asar'),
<       )
75,78d68
<     }
<     case 'linux': {
<       const appName = path.basename(appPath)
<       return path.join(appPath, appName)

And I hope you should focus more on cross-platform development (including linux).

SoulMelody avatar Jun 29 '19 14:06 SoulMelody

:+1: patch kind of worked, except the app I was trying with didn't have a matching folder and executable name, and I couldn't pass the executable directly since it only checks if it ends with .exe :man_facepalming:

DuBistKomisch avatar Aug 12 '19 01:08 DuBistKomisch

Hi, @SoulMelody @DuBistKomisch , thanks for you suggestion!

Debugtron is a desktop app now! Support for linux is working in progress

pd4d10 avatar Oct 30 '19 13:10 pd4d10

The latest v0.3.1 already supports Linux, which could be downloaded from releases page.

Currently we only have zip file bundle. Other bundle formats like deb and rpm are coming soon.

pd4d10 avatar Nov 01 '19 13:11 pd4d10

@pd4d10 thanks, I just tried it out (running from yarn start, can't be bothered installing on arch linux), but it doesn't detect any apps. I tried manually navigating to an app such as /usr/bin/code, but it didn't seem to do anything, nothing in dev tools console either. what am I doing wrong?

DuBistKomisch avatar Nov 01 '19 22:11 DuBistKomisch

@DuBistKomisch Thanks for your quick feedback!

Electron apps detection is not ready at Linux, because there are so many Linux distributions, and their application installed paths seems quite different. It may take a while. Code here: https://github.com/bytedance/debugtron/blob/fedfb644ab7daa545e48a18fb7d755b89d763836/src/main/linux.ts#L5-L8

Could you please provide your Electron app name? I've noticed that the name is code, is it VSCode?

pd4d10 avatar Nov 03 '19 05:11 pd4d10

fair enough, would be nice to be able to load one manually in the meantime at least.

and yeah it's VS Code: https://www.archlinux.org/packages/community/x86_64/code/

I also tried with my own app built using this packager: https://github.com/electron-userland/electron-installer-debian

DuBistKomisch avatar Nov 03 '19 23:11 DuBistKomisch

@DuBistKomisch Seems there are two separated problems:

  • VSCode is not working, because after /usr/bin/code command executed, the current process will quit and the VSCode processes will be running in the background. I've created a new issue #2 to track this.
  • v0.3.1 has some problems on clicking dropzone area to select executable. It is already fixed at the latest v0.4.0

By the way I'm using GitHub Desktop for test at Linux. If there are still problems on your own app, please provide your app's download link. We'll try to fix the case

pd4d10 avatar Nov 04 '19 07:11 pd4d10

tried with latest master, seems to work with some apps (e.g. signal) which get installed to /opt :clap:

our app is available for download here: https://www.vivi.io/downloads

if I open the binary with debugtron, a tab for the app appears for a split second then goes away

DuBistKomisch avatar Nov 05 '19 23:11 DuBistKomisch

@DuBistKomisch Debugtron relies on --inspect switch of Node.js. Tried to run your app with --inspect and seems no inspect session started.

Which packager are you using?

pd4d10 avatar Nov 06 '19 03:11 pd4d10

Still not working 100%. Manjaro linux. When I tell it to open an app like GitKraken from /opt/gitkraken/gitkraken it scans it for a moment then closes BUT that only happens if the app was already OPEN. But if I open an app like GitKraken and I tell Debugtron to "rescan" then the entire interface in Debugtron goes blank.

thenexxuz-zz avatar May 26 '20 14:05 thenexxuz-zz

is support uos arm?

lipei007 avatar Jul 19 '22 07:07 lipei007