question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't run fresh cordova app on ios simulator

See original GitHub issue

I made a new cordova app with the following commands:

$ cordova create ct
Creating a new cordova project.
$ cd ct/
$ cordova platform add ios
Using cordova-fetch for cordova-ios@~4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
	Path: platforms/ios
	Package: io.cordova.hellocordova
	Name: HelloCordova
iOS project created with cordova-ios@4.5.5
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving ios@~4.5.5 into config.xml file ...

Then started an iOS Simulator and waited for it to finish loading and be fully ready. Then:

$ cordova run ios
Building for iPhone X Simulator
Building project: /Users/shawn/git/shawninder/ct/platforms/ios/HelloCordova.xcworkspace
	Configuration: Debug
	Platform: emulator
Build settings from command line:
    CONFIGURATION_BUILD_DIR = /Users/shawn/git/shawninder/ct/platforms/ios/build/emulator
    SDKROOT = iphonesimulator12.1
    SHARED_PRECOMPS_DIR = /Users/shawn/git/shawninder/ct/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/shawn/git/shawninder/ct/platforms/ios/cordova/build-debug.xcconfig':
    CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
    CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
    CODE_SIGN_IDENTITY = iPhone Developer
    ENABLE_BITCODE = NO
    GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
    HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
    OTHER_LDFLAGS = -ObjC
    SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

No target specified for emulator. Deploying to iPhone-X, 12.1 simulator
/Users/shawn/git/shawninder/ct/platforms/ios/build/emulator/HelloCordova.app/Info.plist file not found.

And nothing happens in the simulator. Also perplexing is the fact that the /Users/shawn/git/shawninder/ct/platform/ios/build directory doesn’t exist.

$ ls -la platforms/ios/
total 32
drwxr-xr-x  13 shawn  staff  416 31 Oct 16:25 .
drwxr-xr-x   3 shawn  staff   96 31 Oct 16:25 ..
-rw-r--r--   1 shawn  staff   53 31 Oct 16:25 .gitignore
drwxr-xr-x   7 shawn  staff  224 31 Oct 16:25 CordovaLib
drwxr-xr-x  14 shawn  staff  448 31 Oct 16:25 HelloCordova
drwxr-xr-x   3 shawn  staff   96 31 Oct 16:25 HelloCordova.xcodeproj
drwxr-xr-x   4 shawn  staff  128 31 Oct 16:25 HelloCordova.xcworkspace
drwxr-xr-x  26 shawn  staff  832 31 Oct 16:25 cordova
-rw-r--r--   1 shawn  staff  342 31 Oct 16:25 ios.json
drwxr-xr-x   5 shawn  staff  160 31 Oct 16:25 platform_www
-rw-r--r--   1 shawn  staff  860 31 Oct 16:25 pods-debug.xcconfig
-rw-r--r--   1 shawn  staff  859 31 Oct 16:25 pods-release.xcconfig
drwxr-xr-x   9 shawn  staff  288 31 Oct 16:25 www

Any idea what’s going on?

About my setup:

$ cordova -v
8.1.2 (cordova-lib@8.1.1)
$ node -v
v8.10.0
$ npm -v
6.0.0

iOS Simulator version: Version 10.1 (SimulatorApp-877 CoreSimulator-572.2 xcode version: Version 10.1 (10B61)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
shawnindercommented, Oct 31, 2018

Aha, thanks @dpogue, using cordova run ios --buildFlag='-UseModernBuildSystem=0' solved my issue.

Follow-up questions:

  • Should I be worried about not using the new build system?
  • Is cordova going to support it eventually?
  • Could this perhaps be done automatically by cordova or at least be documented somewhere in the Get Started page?

(Thanks for the quickest github issue reply I’ve ever seen by the way)

1reaction
dpoguecommented, Oct 31, 2018

My guess is that the build is failing due to known incompatibilities with Xcode 10. Does it work if you build with the Modern Build System turned off (see instructions in that linked issue)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

I cant get my ionic app to open in iOS emulator - Stack Overflow
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 ...
Read more >
Q: Can't launch a cordova ios app on device or simulator
I have a cordova-based iOS app, which used to work just fine both in simulator and on an attached device. I would press...
Read more >
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...
Read more >
Cordova Command-line-interface (CLI) Reference
cordova run command. Synopsis. Prepares, builds, and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless ......
Read more >
Unable to run a cordova app - VS 2017
I created a new "Blank App (Apache Cordova)" project from the JavaScript > Mobile Apps project templates section. I then set the project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found