Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'name' of undefined xcode@15 ios17 #1377

Open
LOVETOO opened this issue Oct 9, 2023 · 2 comments
Open

Cannot read property 'name' of undefined xcode@15 ios17 #1377

LOVETOO opened this issue Oct 9, 2023 · 2 comments

Comments

@LOVETOO
Copy link

LOVETOO commented Oct 9, 2023

sudo ionic cordova build ios --prod --release
...
Cannot read property 'name' of undefined.
at /xxx/platforms/ios/cordova/lib/build.js:162:40

return getDefaultSimulatorTarget().then(function (defaultTarget) {
emulatorTarget = defaultTarget.name;

The defaultTarget is undefined.
Running getDefaultSimulatorTarget using sudo yields undefined, while the opposite is true.

The iOS simulator is installed through commands:
sudo xcode-select -s /Applications/Xcode-15.0.app
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl runtime add "/Users/xxx/Desktop/xxx/iOS_17_Simulator_Runtime.dmg"

Environment:
Mac OS 14.0
xCode 15.0
iOS simulator 17.0
ionic/cli@7.4.3
Cordova 12.0.0

@LOVETOO
Copy link
Author

LOVETOO commented Oct 9, 2023

nodejs:16.x

@breautek
Copy link
Contributor

Why are you running as root? Running things as root puts your development machine at risk. Cordova should run without requiring root If Cordova requires root, it might mean you installed it using root so that you're normal user doesn't have permission to read or execute files.

Running simctl under root shows me it has no devices either on my mac machine other than an iPhone 13 /iOS 15.5 and an iPod Touch / iOS 15.5 device (which is kind of odd in itself.) Running simctl under your own user shows all the simulators you'd expect to have. So I this doesn't appear to be a bug with Cordova, but rather with XCode.

You can test this yourself using: xcrun simctl list

sudo xcrun simctl runtime add "/Users/xxx/Desktop/xxx/iOS_17_Simulator_Runtime.dmg"

XCode 15 also ships with iOS 17 runtime + simulators. You don't need to add one yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants