Targeting a particular device in the iOS simulator using Meteor - ios

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.

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.

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

Related

Flutter iOS App not launching after removing USB

So i'm testing a flutter app that builds and installs successfully on an iOS simulator as well as a physical devices. However, when building and installing the app with xcode via the USB, it successfully installs and launches but when the USB is disconnected from my mac and i try to run the already installed device on the iPhone, it shows only the launch / splash screen and fades and closes.
Is there something i'm doing wrong that causes this to happen? As the app works fine when connected with the USB and it's being run.
If the build is in debug mode - it won't open.
if you want to open application after disconnecting, try profile / release mode
flutter run --profile
or
flutter run --release
In iOS, debug build doesn't work without USB. To use the app without USB trying making a release build using flutter run --release

How to get Flutter Application running on real ios device with Windows?

Is there a way to get a Flutter Application running on own ios device with Windows and without paying money?
No, it is not possible to run an iOS simulator on Windows.
The reason for this is the following (highlighting is mine):
Simulator allows you to rapidly prototype and test builds of your app during the development process. Installed as part of the Xcode tools [...]
This means that iOS simulator come only with Xcode. And Xcode is only available on MacOS.
This means that you will either need to run MacOS yourself or use a service that runs your app on MacOS for you.
See also: https://stackoverflow.com/a/28573/6509751
For Flutter this means that you will have to test your code on Android, Desktop, or Web locally. You can still run an iOS simulator in your CI or do something similar to what was described in the answer linked above.

Cordova - console.log file does not exist when using iOS Simulator

When I run cordova run ios --emulator the script exits successfully and tells me, that there's a file (console.log) inside platforms/ios/cordova but there's no such file although I used console.log several times in my code.
Also, Safari does not show my device in the developer menu when it's connected via USB and running the app. I used cordova run ios --device to run the app.
Am I looking in the wrong place? Does the script lie? :D

Cordova / Ionic Framework deploy: Prevent from falling back to emulator

I've setup a small build and deploy server on a shared Mac which remotely checks out an ionic project, builds it and deploys it to a plugged iOS device.
ionic run ios --device
That works fine, but if someone forgets to plugin the iOS device, OSX falls back to running an emulator. This is annoying as it pulls a lot of resources and you have to actually close it physically on the Mac yourself.
Is there a way to PREVENT Cordova, Ionic, OSX, Xcode from starting the emulator if there's no real device plugged in?

How to install cordova(phonegap) ios app to device via cli and not via xcode

I am trying to create a simple project with last phonegap version:
$ phonegap create my-project
$ phonegap build ios
$ phonegap install ios
All works perfectly and I see emulator with my simple application.
But I can't find documentation on how to run my application on device(iphone, for example) and not on a simulator.
All documentation by cordova / phonegap based on examples with cordova's template for xcode.
But last cordova's version don't have template for xcode and all that I need - cli, if I understand correctly?
I already registered as IOS developer and I have a valid iPhone development certificate.
When I connect my device - I can see it in xcode and I can run native application on my device.
But only via xcode.
I will be grateful to any advice.
If the cordova app builds and runs on the simulator, try running cordova run ios --device
This worked for me, when before it was only hitting the simulator.
Alternatively, if that STILL doesn't work for you, when you run codova build ios, to just build the app, you could use itunes to sync the generated .app file in <project_folder>/platforms/ios/build/device/AppName.app
There is an Apple CLI tool canned xcodebuild, as well as this wrapper around it by Facebook. I'd suggest trying out either that or look at the build-in xcodebuild shipped with xcode.
Hopefully one of them will work.
https://github.com/facebook/xctool
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
If you use Cordova CLI, you should be able to do this:
cordova run ios

Resources