Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeting a particular device in the iOS simulator using Meteor

I'm currently developing a mobile app using Meteor v1.0 and trying to test iOS devices using the iOS Simulator.

For Cordova apps, I'm used to doing something like:

cordova emulate ios --target "iPad"

For Meteor, the alternative is:

meteor run ios

On my Mac, running the above Meteor command leads to the app being run on an iPhone 4S emulator. I'm unable to choose what device to emulate like I could when using Cordova.

I've tried switching device through the iOS Simulator after the app gets loaded initially but the app is not available on the device I switch to.

The only solution I have found is to navigate to the Cordova directory (.meteor/local/cordova-build) and run the iOS Simulator directly from Cordova.

Does anyone know a better solution by using Meteor itself or is this not currently possible? I haven't been able to find anything in the documentation. I'm open to testing it using something else but it would be nice to keep everything together with Meteor.

like image 882
dr4g0nus Avatar asked Oct 31 '14 09:10

dr4g0nus


2 Answers

The current solution is to open Xcode by running meteor run ios-device and then select the correct simulator inside Xcode. Unfortunately, ios-sim (the package Meteor uses for the simulator) doesn't make it easy to select the device to simulate.

like image 149
stubailo Avatar answered Sep 18 '22 14:09

stubailo


meteor run ios-device -p 3000 is what I do. Then download the phone gap app for iPad and run it on your IP:

ipconfig getifaddr en0

Then put that in on the phone gap app. So example: 192.168.0.8:3000

like image 24
thetwosents Avatar answered Sep 20 '22 14:09

thetwosents