8 ms·
Show HN: Run dedicated iOS Simulators in the browser
- weiyin 12y agoHi, 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 12y agoI 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
- 13 12y ago> Tons of mac servers, with multiple IOS simulators on each? Maybe a modified iOS Simulator binary that can run hundreds of instances on a single powerful server, would be my best bet.
- B-n-c 12y agoMaybe, but then launching multiples and capturing the screen of them to send off through the sockets seems like there must be something in between. I wonder if its able to see where the session windows are on the screen and screenshotting them to send through, or if they somehow hooked directly in to pull the screen?
- weiyin 12y agoHey 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 12y agoThe 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 12y agoWe 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.
- B-n-c 12y agoThe other piece of magic you are doing is sending in the keystrokes / mouse movements. If you're running multiple iOS simulators on a Mac, how are the key presses / mouse movements not interfering with other users?
- weiyin 12y ago(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/Reference/QuartzEventServicesRef/index.html#//apple_ref/c/func/CGEventPostToPSN https://developer.apple.com/library/mac/documentation/Carbon...
- B-n-c 12y ago(No reply button under your other comment either) Thats a pretty sweet API, never seen that before, thanks! I'm going to play around with it a bit to see what it can do!
- daveytea 12y agoAs previously the Head of BD at App.io, I applaud your efforts! Well done! Quite a few ways you can monetise, good luck! :)
- chrisnolet 12y agoLikewise!! Well done guys. Great to see you've grabbed the torch. Good luck and I look forward to following your progress.
- weiyin 12y agoThanks, it means a lot to us coming from you guys!
- chrisnolet 12y agoCan't wait until you figure out h.264 and the MediaSource API ;) You guys are moving at an incredible pace! Very impressed. ps. I love the new /embed endpoint and iPad support. Keep it coming!
- MichaelApproved 12y agoMore 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 12y agoI 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
- weiyin 12y agoHi Michael. Thanks for taking a look! And sorry our site is having some problems on Firefox. Maybe use Chrome for now until we fix it up. This service we put together would allow anybody to run iOS simulators in the browser for a whole variety of reasons. For example, a developer can easily send builds to clients/colleagues or even embed the demo in a website or blog post. Cheers, Weiyin
- phoboslab 12y agoThis 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
- weiyin 12y agoThanks for the suggestion, that looks like a cool library. A future goal is to be able to provide higher resolution images to fully show off the high DPI displays.
- kolencherry 12y agoWhy not use WebRTC for streaming the video?
- TD-Linux 12y agoYou don't even need to go that complicated. A WebM stream over HTTP is pretty easy and would work well for this.
- weiyin 12y agowe did some testing using compressed video, but ended up finding single frames to be more performant. also, the setup can handle much higher framerate and quality but we've kept things fairly lean for the demo :) can easily handle 15fps w/ high quality images. thanks again for the questions and comments.
- cbhl 12y agoIt's worth noting that Chrome Remote Desktop uses VP8 (which is the video codec used in WebM): http://googleblog.blogspot.com/2012/05/next-step-in-chrome-os-journey.html http://googleblog.blogspot.com/2012/05/next-step-in-chrome-o... If you're having performance issues with it, you just have the video codec tuned wrong.
- tuscany 12y agoRunning 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 12y agohi 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
- miguelrochefort 12y agoMake it work with Xamarin (Windows).
- phmagic 12y agoI'm not sure what problem this solves but it's technically cool.
- fuzzywalrus 12y agoThat was my initial reaction as an iOS developer would have access to Simulators via Xcode. That said, I could see this as a tool for sharing to a client for demo purposes.
- gurkendoktor 12y agoYou 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 12y agoIt 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).
- JosephRedfern 12y agoYo, dawg... http://i.imgur.com/Ib0WUeT.png http://i.imgur.com/Ib0WUeT.png
- weiyin 12y agouh... oh boy. you're really pushing the boundaries of our testing... :)
- LandoCalrissian 12y agoHaha, I'm a little surprised since this was the first thing I did. Actually works pretty well.
- woogiee 12y agonot sure if you care about this one...http://i.imgur.com/OsGo10T.png http://i.imgur.com/OsGo10T.png
- weiyin 12y agoNo worries, that's a mock location. Thanks!
- chrisnolet 12y agoI think that's the Apple store in San Francisco ;)
- tricolon 12y agoI got a little further... http://i.imgur.com/IVktzqU.png http://i.imgur.com/IVktzqU.png
- pit 12y agoWow, I thought I was super clever for doing that, and everybody else thought of it first! http://cl.ly/image/2L3y0c3G2q0j http://cl.ly/image/2L3y0c3G2q0j
- danbruc 12y agoDevelopers are all the same, how could I expect to be the only one thinking of this? Anyway, I made it down to the 4th level in appetize.io-ception before the sessions started timing out. http://i.imgur.com/wCIXQUB.png http://i.imgur.com/wCIXQUB.png
- erjiang 12y agoI'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
- marxdeveloper 12y agoNeeds landscape! Overall very awesome service.
- weiyin 12y agoAgreed! We are also working on supporting additional device types (iPad, iPad mini, iPhone 6(+)).
- DenisM 12y agoThere'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...
- ceeK 12y agoCould 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?
- dcx 12y agoNice 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 12y agoDefinitely on our to-do list. Stay tuned!
- 719Ben 12y agoYou 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.
- maxsavin 12y agoNice. I would consider turning off motion in the settings because it would look less quirky in the videos
- kaivi 12y agoWell, 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 12y agoCould 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 12y agoSimulator 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 12y agoHuh, indeed they are not. Was able to pull a file off my desktop through Safari. Was not aware of that.
- weiyin 12y agoAgreed. This is an issue not just for Safari, but someone can upload a specially crafted app that browses the file system. In this iteration we are using the OS permission system to isolate users. We are looking into more effective sandbox methods. Security is an ongoing process, and we always take an adversarial point of view when evaluating our system.
- vblord 12y agoJust 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 12y agoNot 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.
- mentos 12y agoVery cool, what lead you to develop this?
- niutech 12y agoIt reminds me of Pieceable: http://www.pieceable.com/ http://www.pieceable.com/
- damianknz 12y agohang on. im stuck here. http://imgur.com/F1gLIzb http://imgur.com/F1gLIzb