-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot reload on a remote device #10
Comments
HotAvalonia is a cross-platform library. I don't even use Windows myself, so of course I made sure that it works on other operating systems like Linux and macOS :)
It sure does. HotAvalonia is tooling-independent thanks to the fact that it works directly with your files. This means you can edit them from any text editor of your choice, and hot-reload is gonna work no matter what. However, it also presents some challenges in cases like yours. Citing the README:
Additionally, if the mount point differs from the location of the source project on your PC (which, judging by the fact that you mention Windows, it will, because Windows uses some crazy pathing system), you can provide it manually to the this.EnableHotReload("/path/to/my/project/on/android/App.axaml"); |
Since you are trying to debug the app on a real device rather than via an emulator, mounting may be a bit challenging because it requires root access, which you might not have. In this scenario, I suggest switching gears and moving to an emulator, as a good one will streamline this process for you. |
Thanks for your response! Unfortunately emulators dont work for us. If I understand right, the remote device should have access to the source files on the host computer to be able to watch for changes to make hot reload active, right? Right now, it seems complicated to me. I will try to figure out something. Maybe some kind of drive sync application, where the application keeps folders and files syncronized? Thanks again. Keep up the good work! :D |
Absolutely!
That's why I suggested mounting a network drive, as that's the whole point of their existence. However, mounting a drive on an unrooted Android device is not possible, as far as I know, unless your version of the OS explicitly provides such functionality in the user space (e.g., somewhere in the settings). Therefore, I'm afraid using HotAvalonia is not feasible in your scenario unless you do find a third-party app capable of syncing source files on your PC with their copies on your Android device. What I can do is abstract away calls to the filesystem, allowing me to supply HotAvalonia with different virtual filesystem implementations depending on the context. One of these implementations could establish a connection from your device to a satellite HotAvalonia-branded app running on your PC. For example: this.EnableHotReload(IPEndPoint.Parse("192.168.0.42:1984")); Instead of accessing a local filesystem, the app would make calls over a local network to your PC. This is just a concept, but it should allow HotAvalonia to work in virtually any scenario imaginable. However, it will require a tremendous amount of work. Additionally, with files being sent over the network, there is now a security aspect that needs to be properly handled on my side, and oh boy do I love dealing with security issues. So, yeah, this is definitely not something that's going to be implemented by tomorrow morning :D |
As avalonia is a multi-platform framework, it would be nice if hot reload would work also on other platforms than Windows. Unfortunately it seems to not work on Android (unless i am missing something). When trying to deploy my application to an android device using USB debugging, the method EnableHotReload throws an exception as the appFilepath parameter not exists. The path points to the App.axaml.cs file on my computer. My first guess that the system tries to find this path on the Android device.
Is this is a known issue or simply i missed something crucial? I tried to do everything as the README.txt stated.
Thanks in advance!
The text was updated successfully, but these errors were encountered: