typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 422 forks source link

Bug: android #181

Open Ti-webdev opened 7 years ago

Ti-webdev commented 7 years ago

I'm trying to start hotel under android and got an error:

$ uname -a
Linux localhost 3.18.20-perf-g477e4fa #1 SMP PREEMPT Fri Feb 10 14:34:02 CST 2017 aarch64 Android
$ hotel start
module.js:471
    throw err;
    ^

Error: Cannot find module './startup/android.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/data/data/com.termux/files/usr/lib/node_modules/hotel/node_modules/user-startup/lib/index.js:5:15)
    at Module._compile (module.js:570:32)                                                  at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
typicode commented 7 years ago

Interesting, didn't know it was possible to run Node/Hotel under Android. I'm updating https://github.com/typicode/user-startup to better handle this and then will update Hotel.

Hotel won't be started automatically though. Don't know if it's an issue for you or not?

typicode commented 7 years ago

That said, I'm not even sure it's going to be enough or if there's going to be side effects as Android is kind of an edge case for this project.

Could you try running directly Hotel daemon?

$ node /path/to/hotel/node_modules/hotel/lib/daemon/index.js
Ti-webdev commented 7 years ago

Runnng daemon directly works, thanks. But without cli adding hotel's services unuseful.

Ti-webdev commented 7 years ago

I dug more deeper and saw that without support user-startup cli/daemon.js hotel will not be started :( Maybe we can use $HOME/.profile at user-startup module to fallback on "unsupported" systems?

typicode commented 7 years ago

Just curious, are you running directly an Android environment or is it in a Virtual Machine run from another OS just for Android dev? Do you have some kind of Android laptop?

Do you know if it supports .desktop file and /home/username/.config/autostart? http://askubuntu.com/questions/159008/how-to-add-startup-applications-in-lubuntu

For reference, here's the one generated for hotel on Linux env:

[Desktop Entry]
Type=Application
Version=1.0
Name=hotel
Comment=hotel startup script
Exec=/home/typicode/.nvm/versions/node/v7.4.0/bin/node /home/typicode/.nvm/versions/node/v7.4.0/lib/node_modules/hotel/lib/daemon > /home/typicode/.hotel/daemon.log
StartupNotify=false
Terminal=false
Ti-webdev commented 7 years ago

I'm trying to use just android phone with termux app, just for fun.

Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. A minimal base system is installed automatically - additional packages are available using the APT package manager.

With termux I install node and in many cases it works ok. Desktop Entry looks like not appropriated :(