rhomobile / rhodes

The Rhodes framework is a platform for building locally executing, device-optimized mobile applications for all major smartphone devices.
http://tau-platform.com/
MIT License
1.05k stars 237 forks source link

Xcode 6 - support selection of simulator profile #394

Open jtara opened 9 years ago

jtara commented 9 years ago

Xcode 6 has changed the way simulators are managed. Each combination of simulator profile and OS version now gets a separate simulated environment.

Rhodes build only supports the selection of device family - iphone or ipad. Prior to Xcode 6, you could switch in the simulator between, say, iPad and iPad Retina device, and your app would still be available and you could just start the app. (You could even switch between iPhone and iPad...)

Now that is no longer true. If you switch devices in the iOS Simulator, your app is not there, because each simulator profile gets it's own completely separate environment.

Rhodes currently will start the simulator only in iPad Air if you use ipad in build.yml and iPhone 5S if you use iphone in build.yml.

This is very inconvenient, as iPad Air is too big more most developers screens, so it is easier to test with iPad 2. You can no longer simply switch from iPad Air to iPad 2. The build has to put the executable in the right directory for the specific simulator profile.

Can the build be updated so that there is some value in build.yml to select the specific simulator profile?

Any known work-around in the mean time?

I will experiment with deleting unwanted simulator profiles. That's an extreme work-around, as it limits the use of the simulator for non-Rhodes projects.

jtara commented 9 years ago

Unfortunately, deleting unwanted simulator profiles is not a work-around. Rhodes command-line build will always open iPad apps in iPad Air, even if you delete the profile from the Simulator!

Apparently, it creates a profile. It shows as iossim iPad Air.

jtara commented 9 years ago

It uses the iPad Air simulator profile if it is present. Otherwise, it creates an iossim iPad Air profile, which is added to the Simulator profiles. There doesn't seem to be a way with current Rhodes build to use a non-Retina iOS iPad simulator.

I'll take a look at the code for this.

jtara commented 9 years ago

Can somebody fill me in on where this code came from? It's credited to Plausible Labs, but I don't turn up any source from them directly.

Maybe it comes from here?

https://github.com/phonegap/ios-sim

It looks like there is some new support for Xcode 6 --devicetypeid I think this is what I am looking for.

Can this get updated, and then add something in build.yml to specify the device type id?

jtara commented 9 years ago

The PhoneGap version is derived from the same source, but is way different. It seems much more up to date - it has Landon Fuller copyright 2008-2011 vs just 2008 in Rhodes version. And the support for Xcode 6 device types is readily apparent in iPhoneSimulator.m.

https://github.com/phonegap/ios-sim/blob/master/Source/iPhoneSimulator.m

This might be a more appropriate source for this support, then.

As a work-around, I can try using the PhoneGap launcher to manually launch a Rhodes build into the simulator.

jtara commented 9 years ago

Still an issue in Rhodes 5.0.25. There is still no way to select the desired simulator. iPad is very difficult to debug, because there is no way to select 'iPad 2' device. We get "iPad Air2" which is way too big for any reasonable-sized screen.

jtara commented 9 years ago

Workaround: Xcode 6 iOS simulator now has a scale option. Window>Scale

It is limited, just choice of 100%, 75% or 50%. But this solves the problem of a way-huge window that you have to scroll for the default iPhone and iPad devices.

jtara commented 9 years ago

This is now critical as of Xcode 6.2.

Now, Xcode 6.2 will no longer work with SDKs from previous versions. It has been changed so that now you build for iOS simulator just like you build for hardware - you build with latest SDK and set deployment target for minimum version you want to support.

The launcher needs to be changed so that we can launch the same app (built with highest simulator SDK) into different environments in order to test with older OS.

Maybe workaround is just set the simulator version/device from simulator menu, and then drag the binary onto the simulator?

dmitrys commented 9 years ago

Hi,

You can use XCode with generated XCode project(app folder/projects/iphone) for select any option for launch. I think we should not support all options in build.yml or rake commands - just general. If somebody wants to tune project/launch - he can use XCode project with XCode and change all as he wants.