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.

bug: "npx cap run ios" does not work, when schema was renamed

See original GitHub issue

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 2.4.6
  @capacitor/core: 2.4.6
  @capacitor/android: 2.4.6
  @capacitor/ios: 2.4.6

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 3.0.0-beta.1
  @capacitor/core: 3.0.0-beta.1
  @capacitor/ios: 3.0.0-beta.1

[success] iOS looking great! 👌

Platform(s)

ios

Current Behavior

Running npx cap run expects scheme to be named App and does not considers, that scheme can be renamed.

I have renamed App to Windy as shown in Capacitor documentation.

$ npx cap run 
✔ Please choose a platform to run: › ios
✔ Copying web assets from www to ios/App/App/public in 4.00s
✔ Creating capacitor.config.json in ios/App/App in 1.23ms
[info] Found 1 Cordova plugin for ios:
       cordova-plugin-inapppurchase@1.2.0
✔ copy ios in 4.02s
✔ Updating iOS plugins in 6.82ms
[info] Found 5 Capacitor plugins for ios:
       @capacitor/app@0.3.1
       @capacitor/geolocation@0.3.1
       @capacitor/splash-screen@0.3.1
       @capacitor/storage@0.3.1
       capacitor-rate-app@0.1.1
[info] Found 1 Cordova plugin for ios:
       cordova-plugin-inapppurchase@1.2.0
✔ Updating iOS native dependencies with pod install in 12.09s
✔ update ios in 12.15s
✔ Please choose a target device: › Ivo’s iPhone 11 (00008030-001110D61A38802E)
✖ Running xcodebuild - failed!
[error] Command line invocation:
        /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace App.xcworkspace
        -scheme App -configuration Debug -destination id=00008030-001110D61A38802E
        -derivedDataPath
        /Users/ivo/windyty/capacitor-ios/ios/DerivedData/00008030-001110D61A38802E
        
        User defaults from command line:
        IDEDerivedDataPathOverride =
        /Users/ivo/windyty/capacitor-ios/ios/DerivedData/00008030-001110D61A38802E
        
        xcodebuild: error: The workspace named "App" does not contain a scheme named "App". The
        "-list" option can be used to find the names of the schemes in the workspace.

Expected Behavior

npx cap run will detect schema or default schema can be passed to the xcodebuild as CL argument

Code Reproduction

Other Technical Details

npm --version output:

node --version output:

pod --version output (iOS issues only):

Additional Context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
lirbankcommented, Apr 9, 2021

For anyone running CLI 3.0.0-rc.0 - you also have to update your capacitor.config.ts file and rerun ‘cap sync’.

import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
  appId: "com.example.myapp",
  appName: "My App",
  webDir: "www",

  // Add this:
  ios: {
    scheme: "My App",
  },
};

export default config;
5reactions
allidoisacecommented, Oct 13, 2021

For anyone running CLI 3.0.0-rc.0 - you also have to update your capacitor.config.ts file and rerun ‘cap sync’.

import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
  appId: "com.example.myapp",
  appName: "My App",
  webDir: "www",

  // Add this:
  ios: {
    scheme: "My App",
  },
};

export default config;

I still end up running into a follow up issue:

> capacitor run ios --no-sync --target 00008027-001E40590A6A402E
[react-scripts] Compiling...

[capacitor] ✔ Running xcodebuild in 90.18s
[capacitor] ✖ Deploying MyApp.app to 00008027-001E40590A6A402E - failed!
[capacitor] [error] ERR_UNKNOWN: Path '/......./app/ios/DerivedData/00008027-001E40590A6A402E/Build/Products/Debug-iphoneos/MyApp.app' not found
[capacitor]         
[ERROR] An error occurred while running subprocess capacitor.
Read more comments on GitHub >

github_iconTop Results From Across the Web

" npx cap add ios" fails with error "Updating iOS native ...
I ran the following command in the terminal. sudo xcode-select --reset. and got rid of the error for me.
Read more >
Capacitor Configuration | Capacitor Documentation
If you are not using TypeScript in your project, you can use a capacitor.config.json ... configure the flavor you want to run with...
Read more >
Untitled
(Billy Tsai) - x86/Kconfig: Do not enable ... imageblit (Igor Matheus Andrade Torrente) - qnx4: work around gcc false positive warning bug (Linus...
Read more >
CodeHS Glossary
Often used when error-based and union-based SQLi do not work. ... Commenting out code makes the computer ignore it, so it does not...
Read more >
Error after changing app name - Capacitor - Ionic Forum
Has anyone else seen this, is the only problem i've encountered with ... ios folder, and recreate it again by running npx cap...
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