
Show HN: Run dedicated iOS Simulators in the browser - weiyin
https://appetize.io/
======
JosephRedfern
Yo, dawg... [http://i.imgur.com/Ib0WUeT.png](http://i.imgur.com/Ib0WUeT.png)

~~~
weiyin
uh... oh boy. you're really pushing the boundaries of our testing... :)

~~~
woogiee
not sure if you care about this
one...[http://i.imgur.com/OsGo10T.png](http://i.imgur.com/OsGo10T.png)

~~~
weiyin
No worries, that's a mock location. Thanks!

------
phoboslab
This is really cool!

The "video" quality is pretty bad though. From what I can see, the app streams
base64 encoded JPEGs via WebSockets and draws them in a Canvas. The overhead
of sending complete images costs a lot of bandwidth.

You may want to look into jsmpeg for live streaming:
[https://github.com/phoboslab/jsmpeg](https://github.com/phoboslab/jsmpeg)

~~~
TheMakeA
We've actually experimented with jsmpeg for this type of thing. The problem we
ran into was that jsmpeg seemed to require every frame from ffmpeg. If the
browser or network slowed, the feed would fall behind the simulation, leading
to several seconds of latency when interacting.

We'd love to use it and appreciate your hard work though. Do you have any
ideas on how that problem can be solved?

~~~
phoboslab
There are two sides to this problem. For jsmpeg (or even in the server), it
would be possible to simply wait for the next intra frame (a frame that
doesn't require previous frames to decode) on certain conditions and throw
away all other frames in between. This will give the decoder and network time
to catch up. By default ffmpeg emits one intra frame per second, iirc.

The more difficult part is probably detecting this lag. I'm not sure how this
could be done. Maybe the node websocket server (ws) can detect congestion
somehow.

~~~
TheMakeA
Thanks. Maybe our ffmpeg settings weren't creating intra-frames somehow (or we
happened to drop every single one) because the stream would never recover.
I'll probably try it again at some point soon. We _really_ want jsmpeg to
work.

------
tuscany
Running an iOS simulator in the browser is different from using a browser to
connect to an iOS simulator on a server. That said, this is still cool!

My only question is how you're going to combat abuse. You're basically
providing free servers in the demo. The economics of doing that means no
amount of captcha will save you (it's been tried many times).

Even if you don't provide a demo and charge for simulating, you're buying into
a whole new problem of metering while maintaining a sane price. Comments?

That said, congratulations on shipping working software!

~~~
weiyin
hi tuscany,

all solid points, and thanks for your support.

we will definitely need to think through abuse, server costs, etc. it's a
pretty lean setup but still gotta run on mac hardware :)

weiyin

------
weiyin
Hi, thanks for checking us out. We're happy to answer any questions in the
comments.

Some of you may be familiar with app.io's demo pages service which was
discontinued in August. We loved using their service and we thought it'd be a
blast building a replacement.

Technologies used: node, socket.io, mongodb, html5 canvas

~~~
B-n-c
I understand those are the web technologies, but how is this being run in the
back? Tons of mac servers, with multiple IOS simulators on each? One running
per user on the mac? Custom software to control and pass through to the
socket?

Care to shed any light as to an overview on how the backend works? I've always
been curious since I first saw App.io

~~~
weiyin
Hey B-n-c, You are pretty much spot on with everything you mentioned.

Apparently app.io had some setup w/ VMs running on lightweight hypervisors
([https://macstadium.com/casestudies](https://macstadium.com/casestudies)),
but we found we didn't have to have all that overhead to run multiple
simulators per machine.

And you're exactly right about the small piece of custom code to pass controls
and send frames. We're big fans of socket.io - pretty powerful stuff!

Happy to answer follow-ups if we missed something.

Thanks, weiyin

~~~
B-n-c
The one piece that puzzles me is how the frames are being captured from the
iOS simulator. Are you launching multiples per user account, where each one is
a different session at a different portion of the screen, and essentially
screenshotting each? Or did you modify the simulator somehow and are hooking
in to grab the screen, so that way its irrelevant of their position on screen?

Thanks!

~~~
weiyin
We wrote some custom OS X code to capture frames from individual processes.
That way the simulators don't need to be positioned in any way or even
visible. Cheers.

~~~
weiyin
(don't see a link to reply under your last comment)

yea, so the incoming keystrokes and mouse movements are managed through some
custom OS X code as well.

the specific method we're using is CGEventPostToPSN, more information here:
[https://developer.apple.com/library/mac/documentation/Carbon...](https://developer.apple.com/library/mac/documentation/Carbon/Reference/QuartzEventServicesRef/index.html#//apple_ref/c/func/CGEventPostToPSN)

------
kaivi
Well, this is cool, but Safari allows for loading basically any file located
on the filesystem. For instance, trying file:///etc/passwd results in file
found but can not be opened by Safari.

That could be an attack vector.

~~~
shortstuffsushi
Could you explain where you think the issue here is? Are you saying, as a user
trying to upload, you could possibly (presumably accidentally) upload your
passwd, or as a user of their site, you could somehow see their passwd file?

If it's the former, I think that's a 'vulnerability' with any site that has a
file chooser.

If it's the latter, could you elaborate where and how you would do so? Perhaps
you're saying you could load it through the simulator that's running on the
actual computer/vm somewhere, but those simulator environment are sandboxes
(afaik) so that you could only access files on within the simulator's context.

~~~
chrisnolet
Simulator instances aren't sandboxed, so you can transverse the master
system's file system with a malicious iOS app. This is indeed an attack
vector.

~~~
shortstuffsushi
Huh, indeed they are not. Was able to pull a file off my desktop through
Safari. Was not aware of that.

------
vblord
Just having the simulator isn't enough for us Xamarin developers. One big
issue with Xamarin is that you need a mac (with xcode installed) on the
network in order to do builds. If you could solve that issue along with the
having the simulator online then you have my money.

~~~
viktorbenei
Not ideal but you can use an iOS CI/CD / build automation service like Bitrise
([http://www.bitrise.io/](http://www.bitrise.io/)) (co-founder / CTO here) to
do the builds for you. If the simulator service has an API you can even
automate the connection with Bitrise.

There are a few online code compilers too like this Swift one
([http://swiftstub.com/](http://swiftstub.com/)) to work with.

Certainly not ideal but probably not impossible.

P.S. at this time you're probably better with an OS X VPS.

------
MichaelApproved
More information about what the site does would be helpful. Also, I get this
error on Firefox/Windows "no video with supported format and mime type found"

Edit: also click on the demo and saw the simulator but couldn't get it to do
anything. What is supposed to happen in the simulator? Should I be able to
click on something? _Any_ instructions/information would be helpful. Right now
you're assuming everyone knows what the site is about and what the simulator
is supposed to do.

~~~
ironcrucible
I had the same issue, using Firefox 33 on Windows 8.1. It looks like switching
to Chrome fixed the demo. Would be nice to have some sort of notice that
certain browsers aren't supported (if that's the case).

Also, fonts are rendering poorly in Firefox and Chrome [0]. Bumping the font-
weight up to at least 400 makes the text much more legible.

[0]: [http://imgur.com/2wVXvUr](http://imgur.com/2wVXvUr)

------
erjiang
I'd be willing to pay money for this, seriously. I've followed you on Twitter
- let me know if anything happens.

We were using and enjoying app.io[0] until they decided to pivot and stop
serving us.

[0] they didn't support pinch gestures, which made using a map impossible

------
719Ben
You may want to watch out for people using this a proxy to do bad stuff with
your servers. I noticed that all traffic is coming from Georgia, not my
computer.

------
DenisM
There's market here for training corporate users over the internet to use line
of business iPad apps.

I'd pay for it, if it actually made training easier...

------
dcx
Nice work! I might pay for a version of this to get our graphic designer off
using Xcode (my app uses an art/config format which can be pulled from a web
server). Especially if it could help them quickly test results on multiple
device formats and iOS versions. It'd be handy to have a slower full-
resolution option too!

~~~
weiyin
Definitely on our to-do list. Stay tuned!

------
ceeK
Could this be used without the frame to emulate iOS apps on the web?

I.e, with AutoLayout, can you not adjust the frame of the app to be that of
Android, and therefore have a semi-legit looking webapp for Android without
developing a responsive website?

------
phmagic
I'm not sure what problem this solves but it's technically cool.

~~~
gurkendoktor
You can let users play around with your paid app to see if it works as
expected. Certainly cleaner than messing with In-App-Purchases or a separate
"Lite" version of your app.

I've heard in one episode of the Core Intuition podcast that Panic has
actually spent some time polishing a simulator build of Transmit(?) for iOS,
for use with app.io (a service which did the same thing as the OP until they
pivoted). This is something I'd also love to do if this business promises to
survive longer than app.io did.

This is especially interesting if you are an iOS freelancer who wants to show
off their work, without clients having to create accounts etc. :)

~~~
chrisnolet
It was a demo of Panic's DietCoda! It was running for a while but I think it's
been taken down now (since App.io's pivot maybe).

------
niutech
It reminds me of Pieceable:
[http://www.pieceable.com/](http://www.pieceable.com/)

------
maxsavin
Nice. I would consider turning off motion in the settings because it would
look less quirky in the videos

------
miguelrochefort
Make it work with Xamarin (Windows).

------
marxdeveloper
Needs landscape! Overall very awesome service.

~~~
weiyin
Agreed! We are also working on supporting additional device types (iPad, iPad
mini, iPhone 6(+)).

------
mentos
Very cool, what lead you to develop this?

------
damianknz
hang on. im stuck here.

[http://imgur.com/F1gLIzb](http://imgur.com/F1gLIzb)

