Cannot Emulate IOS after signing app for iPhone

Hi, I’m running into an issue that I can’t seem to solve by simply google-ing around.

I am running ionic and everytime I try to run an ios emulate after I have installed the app to my phone to test I get the following error.

/usr/local/bin/ionic cordova run --confirm --no-interactive --emulator ios -lc
[WARN] Multiple network interfaces detected!

       You will be prompted to select an external-facing IP for the livereload server that your device or emulator has access to.
       You may also use the --address option to skip this prompt.
       

[INFO] Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser --iscordovaserve --platform ios --target cordova - Ctrl+C to cancel
[09:36:33]  watch started ... 
[09:36:33]  build dev started ... 
[09:36:33]  clean started ... 
[09:36:33]  clean finished in 2 ms 
[09:36:33]  copy started ... 
[09:36:34]  deeplinks started ... 
[09:36:34]  deeplinks finished in 22 ms 
[09:36:34]  transpile started ... 
[09:36:36]  transpile finished in 2.62 s 
[09:36:36]  preprocess started ... 
[09:36:36]  copy finished in 2.77 s 
[09:36:36]  preprocess finished in 67 ms 
[09:36:36]  webpack started ... 
[09:36:42]  webpack finished in 6.24 s 
[09:36:42]  sass started ... 
[09:36:43]  sass finished in 848 ms 
[09:36:43]  postprocess started ... 
[09:36:43]  postprocess finished in 5 ms 
[09:36:43]  lint started ... 
[09:36:43]  build dev finished in 9.93 s 
[09:36:43]  watch ready in 9.96 s 
[09:36:43]  dev server running: http://localhost:8100/ 

[INFO] Development server running!
       Local: http://localhost:8100
       External: http://192.168.3.200:8100, <REDACTED>
       
> cordova run ios --emulator
Error: Cannot read property 'indexOf' of null
[ERROR] An error occurred while running cordova run ios --emulator (exit code 1).

Here’s my ionic info. This is on an ionic blank project.

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.11.0
    ionic (Ionic CLI) : 3.11.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : browser 5.0.1 ios 4.5.2
    Ionic Framework    : ionic-angular 3.7.1

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v8.7.0
    npm        : 2.15.12 
    OS         : macOS Sierra
    Xcode      : Xcode 9.0 Build version 9A235 

Misc:

    backend : pro

I think it may have to do with my config.xml but I can’t find a solution and I’ve been blocked for 6 hours now.

Edit: as an extra note when I remove the ios platform and try to re-add it this happens:

Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-ios@~4.5.1

        Adding ios project...
        Creating Cordova project for the iOS platform:
                Path: platforms/ios
                Package: io.ionic.starter
                Name: MyApp
        iOS project created with cordova-ios@4.5.2
        Error: Cannot read property 'indexOf' of null

Can you remove the platform again and run the add command again with --verbose at the end?

Hi sujan12,

I solved this issue by uninstalling all my npm packages globally and uninstalling npm.
I reinstalled npm and ionic cordova and it’s working again.

Not the ideal solution but It’s all working in new projects.

Can you tell me specifically which packages did you uninstall?

Hi @Sujan12, this error is happening for me as well. Here is what it shows when i run “ionic cordova build ios --release --verbose”

[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/Apple/Documents/Gisela/CalculAAI copy', local: false, 
        binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: 
        '/usr/local/lib/node_modules/ionic/dist/index.js' }
Running app-scripts build: --platform ios --target cordova
[11:01:33]  build dev started ... 
[11:01:33]  clean started ... 
[11:01:33]  clean finished in 11 ms 
[11:01:33]  copy started ... 
[11:01:34]  deeplinks started ... 
[11:01:35]  deeplinks finished in 1.44 s 
[11:01:35]  transpile started ... 
[11:01:46]  transpile finished in 10.86 s 
[11:01:46]  preprocess started ... 
[11:01:46]  preprocess finished in 1 ms 
[11:01:46]  webpack started ... 
[11:01:47]  copy finished in 13.40 s 
[11:02:04]  webpack finished in 17.93 s 
[11:02:04]  sass started ... 
[11:02:09]  sass finished in 4.48 s 
[11:02:09]  postprocess started ... 
[11:02:09]  postprocess finished in 16 ms 
[11:02:09]  lint started ... 
[11:02:09]  build dev finished in 35.47 s 
> cordova build ios --release
Cannot read property 'indexOf' of null
[ERROR] An error occurred while running cordova build ios --release (exit code 
        1).