shinyMobile
shinyMobile copied to clipboard
refuse to connect in the example code for preview_mobile
Hi, I am trying to reproduce the example as follow
preview_mobile(appPath = system.file("examples/gallery/app.R", package = "shinyMobile"),
device = "iphoneX")
However, the phone screen does pop up in the browser but it said that "127.0.0.1 refused to connect.". Not sure if I set up things correctly. Thank you!
FYI, the url in the web browser is http://127.0.0.1:1919/

are you behind a proxy?
Not really.
What OS are you using? Alternatively, you could try to run the app in a new process:
p <- processx::process$new(
"Rscript",
c(
"-e",
"options('shiny.port'= 2811); shinyMobile::f7Gallery()"
)
)
# TRUE if the app is running
p$is_alive()
and then call preview_mobile pointing to the port previously fixed (2811):
shinyMobile::preview_mobile(url = "http://127.0.0.1:2811", device = "iphoneX")
The url could also be http://localhost:2811
Thanks. I am using the macOS 10.15.5. I tried the command which still doesn't show any preview.


I'm having the same problem! I don't understand how the package documentation doesn't contain instructions on how to run the application as if you were using a mobile phone. Obviously I'm not interested in seeing the app as if it were on a desktop. When I run the command
preview_mobile(appPath = system.file("app.R", package = "shinyMobile"), device = "iphoneX")
the message appears in the console:
Copy in your terminal (not the R console):R -e "shiny::runApp('',port=3838)"
This is wrong!!!!! At the very least, the current directory of the "app.R" file should appear.