Simulator plans for cocos2d-x metal

As we all know, metal currently does not support simulators. In case this remains and cocos-metal becomes official, is there any plan by the team to create some kind of simulator like Unity player? Cocos2d-x is a free solution and iOS devices are very very expensive these days. If a cocos2d-x developer will need to buy 1 of each device in order to test his game, that would translate to a very high cost. Let’s discuss solutions!

Can’t you run it as a Mac-App? You can set any resolution you want. On top of this 1 iPad and 2-3 iPhones (X, 7, 7 plus for example) should be more than enough.

Based on expierience, you need iphone 5, 6, 6+, x, xr, x-max. This are the different resolutions available now and thats only iphones, and more iphones will follow. For ipads, not sure if 1 will cover. U need the basic one but now there are also many pro versions like 10.5, 11, 12, 12 no home button etc. Have never tried running as mac app, not sure about it.

I agree and disagree at the same time. Sure, having all devices is ideal, I think these minimal list is enough as others simply differ a bit in resolution. The one exception is iPhone X (and 3 new ones), because safe area adds extra layer of complexity. Older devices can be easily simulated in mac os app.

I tried to run app on mac but our app uses a lot of ios libraries, analytics, crashes, ad attribution, ads etc. Also some of our screens like settings or some alerts are using native ios views. Therefore, app can’t just run without many changes and placing defines everywhere. Even if it runs, it would miss specific functionality. I guess its easier if your app is not freemium and doesnt have a big integration of ios native libraries.

Well yes, our apps don’t use many of native alerts. But, from the other hand, if native functionality works for example on iPhone X, it’d also work on iPhone XS/XS Max/R, at least with the same iOS version. It’s much less pain than android.

Simulator of course is better choice, but it’s not ideal either - not all of stuff works and some even work differently than on device.

In my experience that’s not 100% true. We do have an iOS app, which streams videos from Firebase Storage in the system video player. It works perfectly on an iPhone X, but on iPhone Xs/Xr will report an error in the system log files. But we never find out yet, what the problem was. In the log is something like: “unsupported resolution”, which is really strange, because everything works on the iPhone X.

I think we can all agree that is more flexible if there is a working simulator. I would like to hear from cocos team if there is any possible way without apple that this could be done in any way. Otherwise, only options seems indeed running for mac and doing all extra work to by-pass native ios screen/ block them from appearing.

But how can non-apple team can develop simulator that will run all iOS library on it???
Its not possible.
Its Apple’s job.

  1. Maybe someone has info of whether apple has on the works to support metal in simulator.
  2. What I had in mind to do was to have both open-gl and metal in my project and in-case i want to test just UI staff how it looks, use open-gl cocos and handle breaking changes (last time i tried breaking changes were minimal for my project). Ofcoruse this can be done if you run in ios version that will support open-gl so i guess it will exclude super new phones running on ios with no metal. If there was a way to set ios simulator to any resolution, that would be perfect.

+1
I asked for the same. There should be flag/Macro to switch between Metal & OpenGL.

We can ask @zhangxm to read this topic when he has extra time. He is very busy these days.

Current design can not switch to opengl/metal at runtime, it is complex to achieve it. Support OpenGL on iOS is possible, but it is just for testing, so it is low priority.

Not at runtime, but what about macro for the same?

Yes, we don’t need to support it at runtime. As smitpatel88 suggested, a macro would be fine. And yes we don’t need it right now of course and it can be low priority, but it would be nice to know that we have this option in case apple will not support metal in simulator and cocos team is willing to do it if needed )

To be honest i would like to move to metal version earlier even if apple doesnt kill open-gl to get the advantage of better performance but only if i can still debug on simulators with open gl.

Is it for sure, that Metal will be faster out of the box?

Citing WWDC video, it says that "The result is Metal, which can provide up to 10✕ the number of draw calls for your app compared to OpenGL ES. ". And this was for metal 1. I would expect Metal 2 to be even faster out of the box. However, of course it all depends and how good the implementation is from cocos team and if they apply all optimisations necessary etc. We have to wait for actual tests to come out. From what i know, cococs2d-x metal alpha 0 had performance issues but focus of the team was not performance but to have a working version. After team focuses on performance and it’s ready, we can give it a try.

I just hope Apple won’t remove OpenGL just yet.

Metal 2 won’t be faster than Metal 1 out of the box. Metal 2 introduces various new API’s and features that can accelerate certain tasks or even make them possible in the first place. If you don’t use them or have no usage for them, you’ll gain nothing from just Metal 2.

Also, be careful with that “10X the number of draw calls” statement from Apple. I haven’t seen the original talk so take it with a grain of salt, but I’m pretty sure that the “10X” is just a marketing value, which was achieved within a highly specialized environment that is probably very far from any “real world” application.