Titanium CLI choose iPhone type - appcelerator

I'm trying to work with the Titanium CLI (appc). This is what I'm running:
appc run --platform ios --liveview --target simulator --ios-version 9.3 --sim-type iphone --sim-version 9.3 --skip-js-minify
How can I set the specific device to run on (iPhone 4s, 5, 6, 6s, 6s plus ...)? like I choose from Appcelerator Studio?
Also, I'm using Genymotion for Android emulators - I can I use CLI to run on specific emulator?
EDIT
I'm running the following command to run on Android Genymotion emulator:
/usr/local/bin/node /Users/ophir/.appcelerator/install/5.3.0/package/node_modules/titanium/lib/titanium.js build run --platform android --log-level trace --sdk 5.3.0.GA --project-dir /Users/ophir/Documents/Appcelerator_Studio_Workspace/MyApp/App --target emulator --android-sdk /Users/ophir/Library/Android/sdk-titanium --device-id Samsung Galaxy S6 - 6.0.0 - API 23 - 1440x2560 --skip-js-minify --liveview --deploy-type development --no-colors --no-progress-bars --no-prompt --prompt-type socket-bundle --prompt-port 55633 --config-file /var/folders/4x/8mnrwxd51rb3zmn36p6x30w40000gn/T/build-1466517191446.json --no-banner --project-dir /Users/ophir/Documents/Appcelerator_Studio_Workspace/MyApp/App
And I'm getting the following error:
[ERROR] Invalid "--device-id" value "Samsung"

If you want to replicate a studio build, check the console in Studio for the build commmand line that has been generated.
So for iOS the key params are :
build run --platform ios --target simulator --ios-version 9.3 --device-family iphone --sim-type iphone --sim-version 9.3 --device-id XXXXXXXXXXX
you can either cut + paste the UDID of the simulator you are interested in from your studio build, or in Terminal run :
xcrun simctl list
and pick the UDID of the simulator you want.
For Android
build run --platform android --target emulator --device-id 'Google Nexus 5X - 6.0.0 - API 23 - 1080x1920'
Get the emulator name by :
/Applications/Genymotion\ Shell.app/Contents/MacOS/genyshell -c "devices list"
Genymotion shell docs

The only way I can get Titanium to allow me to choose a simulator is by using the following, with two -
ti build -p ios --C
My Titanium version is 5.0.14

try this code
ti build -p ios -C ?

Related

I cant get my ionic app to open in iOS emulator

My new ionic app won't run in the iOS emulator.
Its a fresh install of ionic and Xcode, these are my steps:
npm install -g ionic
ionic start myApp tabs
ionic cordova platform add ios
ionic cordova build ios
ionic cordova emulate ios
Then I get the following error:
No target specified for emulator. Deploying to undefined simulator
/localhost/myApp/platforms/ios/build/emulator/MyApp.app/Info.plist
file not found.
According to this thread (Fresh Ionic Fails to Emulate iOS 12 - Info.plist file not found) it should work with the following command:
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
But then I get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
And then according to this thread (Issues starting iOS simulator from CLI) it should work by updating ios-sim like this:
cd platforms/ios/cordova && npm install ios-sim#latest
But I still get the following error:
No target specified for emulator. Deploying to undefined simulator
Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
Ionic:
ionic (Ionic CLI) : 4.10.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.0.1
#angular-devkit/build-angular : 0.12.4
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.4.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : ios 4.5.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
The problem lie with ios-sim package which couldn't detect running simulators.
Updating to 8.0.1 with the following steps resolved the issue for me.
force update ios-sim to a working version
IMPORTANT needs to be done from inside the platforms/ios/cordova directory.
cd platforms/ios/cordova && npm install ios-sim#8.0.1
check if devices are now listed, takes a few seconds
ionic cordova emulate --list
installs appscript if not installed already
ionic cordova build ios
try to deploy to simulator
ionic cordova emulate --release --prod --livereload ios -- --buildFlag="-UseModernBuildSystem=0"
This will find any running simulator and deploy the app
Try just building the project and then running it from Xcode instead first.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Then open the platforms/ios folder in Xcode and you'll be able to run it from there plus see any errors there may be with the project. When you eventually decide to push the app to the store you'll need to do this anyway.
EDIT
Then try targeting a specific emulator:
ionic cordova emulate ios --list get list of available targets to copy into the next command.
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1" example targeting iPhone XR.
The issue is related to a breaking changes on Xcode 10 not already reflected on ios-sim. You can check on ion-sim repo issue "List empty of devices simulator with Xcode 10".
The issue have already been fixed but is waiting for a new release submission.
You can continue running your App on emulator directly from Xcode.

No emulators available for cordova

For some reason I have no emulators available in cordova / ionic.
Cordova:
$ cordova run ios --list
Available ios devices:
Available ios virtual devices:
Ionic:
$ ionic cordova emulate --list
> cordova run --list --emulator
Available ios virtual devices:
I don't understand why this is happening or how to install them. When I open xcode, they are available, but they do not appear in the CLI.
Give this one a try:
cd platforms/ios/cordova && npm install ios-sim#latest

How to run NativeScript app in Windows using Visual Studio Emulator?

How to run NativeScript app in Windows using Visual Studio Emulator?
trying to get this project:
https://github.com/avatsaev/nativescript-master-detail-angular2
to run in Windows 10 64bit visual studio emulator but always android emulator is launching instead when running:
this is my adb devices:
List of devices attached
169.254.138.177:5555 device
tns livesync android --emulator --watch
also tried
tns livesync 169.254.138.177:5555 --emulator --watch
no luck!
regards
Sean
found the answer
tns run android --device 169.254.138.177:5555
and you get the device from:
adb devices
enjoy!
If the emulator is already running and visible with adb devices - you can just run tns run android. This will build and deploy on all visible devices. Same is valid for tns livesync android.

AppGyver launching iOS simulator gives error XCode is not installed

I am using AppGyver, Steroids Installation has been done and I have successfully created the demo project. I am trying to configure the iOS Simulator for Appgyver so that i can launch my app on simulator using steroids command line and debug the app but when i want to simulate it on ios simulator it gives XCode is not installed. But I have XCode installed and Command Line tools too.
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables​ - PRINT
pkgutil --pkgs='com.apple.pkg.Xcode.*'​ - NO OUTPUT
When I use xcode-select --install It gives "xcode-select: error: command line tools are already installed"
When I use open /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app - Simulator Launch
​
OS Version : Mac OS X Yosemite 10.10
​XCode : 6.1
iOS Simulator : Version 8.1 (550.3)
Node : v0.10.24
NPM : 1.3.21
​​
Please help me to resolve this issue. Any help will be much appreciated.

IOS emulator working app is not installed on it

I have started the IOS emulator through apache cordova CLI and it works, says the build is successful. I can interact with the emulator however my app is not installed on it?
Is there a command that im missing to install my app on this emulated device?
Thanks
To build
cordova build ios
To run in emulator
cordova emulate ios
To run in device
cordova run ios
It might be a bug in Cordova CMD. Try the following commands from your project root directory:
1) cordova build --emulator
2) ios-sim launch platforms/ios/build/emulator/<your_app_name>.app --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-5s, 8.1"
If you don't have ios-sim install it: npm install -g ios-sim

Resources