ionic cordova run ios - nothing happens - ios

I'm trying to deploy my Ionic app to an iPhone by running either of these commands:
ionic cordova run ios
ionic cordova run ios --device
The console displays the following text:
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
If we look at the console output everything seems to be fine, but my iPhone doesn't detect anything and the application doesn't run. I managed to get it on my phone by opening the workspace file inside the platforms/ios and running it with Xcode, but that's a pretty tedious process, and I'm sure that's not the way to go, as it doesn't support livereload.
Also, I tried to start a new project and I'm having the same issue, so I guess it's not any plugin's fault.
Thanks in advance for your answers.

When you run the app from Xcode, does Xcode give you any more error messages in its output window? This may be a signing issue.

same error here from console.
with --verbose
get this message
registerShutdownFunction.process.exit/normal shutdown

Related

Xcode running iOS app without updated code. Ionic live reload not working

ionic cordova emulate ios -l <target>
Does not work for me. I get an error suggesting that I am targeting the wrong device even though the device I am targeting is listed as a virtual device when running the command:
ionic cordova emulate --list
When I run the app with Xcode instead it works however it does not reload my edits, even if I stop and start the app again.
*** disclaimer: this is both a quick and dirty solution to the aforementioned issues ***
Before running your app in Xcode (pressing the play button), in your project directory run the following command:
ionic cordova prepare ios
This will load your changes and update your app in Xcode before running it in your emulator so you can then debug and see your edits.
Open to suggestions if anyone has a more direct solution!
Try:
cleaning the build folder in Xcode: cmd+shift+k
In the "Device" menu of Simulator, click "Erase All Content and Settings"
Quit Xcode, simulator and whatever program you are running the emulate command in
Reboot the machine

Could not connect to development server - React Native

I am creating an app using react native. I tried to change a file path to an image within my code and when I ran my app on the iOS emulator the following message was displayed.
I have tried a number of different methods such as closing the terminal and running the app again.
I also tried running localhost:8081 in my browser and was given the following message
I have also tried deleting my node_modules folder and running yarn but this still hasn't fixed the problem.
Any ideas as to how I would fix this?
You can try to clean xcode, remove app in the simulator
cd ios
xcodebuild clean
run bundler
react-native start --reset-cache
Replace the actual IP Address with the "localhost" in the Url and that should fix the issue if the url is proper.
Fully delete the app on the iOS Simulator, then rebuild the app from xcode.

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

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

iOS emulator no longer running from command line using phonegap

My iOS emulator is no longer opening when I run "phonegap run ios" in the terminal on Mac OS X. I receive no error messages and:
[phonegap] Platform "ios" deployed to emulator.
[phonegap] successfully installed onto emulator
While this is currently a known bug, you can run the emulate command more directly (note you need to build separately):
phonegap local build ios
/platforms/ios/cordova/emulate
You can also run the application using the same technique:
phonegap local build ios
/platforms/ios/cordova/run
NOTE: When using this method to run the app on your phone, the task might get stuck on the splash screen. To fix this, launch the Activity Monitor on your Mac and quit any processes with the name "ios-deploy". From there you can launch the application on your phone by clicking the application icon.
Or, you can even look inside the generated /platforms/ios folder and launch XCode project directly to test in an emulator or on your device. Open project and click the RUN button.
IMPORTANT: with all of the above methods, you MUST run the build command before running:
phonegap local build ios
Not really an answer, but I can say this is a known bug. Here is the bug so you can track it:
https://issues.apache.org/jira/browse/CB-5103
I only had this problem after upgrading to 3.1. I downgraded to 3.0 and it works more reliably:
npm uninstall -g phonegap
npm install -g phonegap#3.0
Also had to delete the platform/ios dir and plugins/ios.json and then run 'phonegap build ios' and 'phonegap run ios'

Resources