Closed shazron closed 5 years ago
Since the update to iOS 12.2 / Xcode 10.2 (after Apple keynote on Monday 25th of March) cordova is not able to find and deploy to a "defined" simulator:
BUILD SUCCEEDED No target specified for emulator. Deploying to undefined simulator app:cordova-conf Updated Cordova config.xml +2ms
...and nothing happens...
Deploying onto a connected physical iOS device is possible without any problems... strange
I checked this:
ios-sim showdevicetypes
shows up all devices as expectedxcrun simctl list
shows up all devices as expectedcordova run --list
shows only empty lists!Specs:
Same Problem for me. Here is my ionic info
Ionic:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.4 @ionic/app-scripts : 3.2.3
Cordova:
cordova (Cordova CLI) : 8.0.0 Cordova Platforms : android 6.4.0, ios 4.5.5 Cordova Plugins : cordova-plugin-ionic 5.2.1, cordova-plugin-ionic-webview 3.1.0, (and 16 other plugins)
System:
ios-deploy : 2.0.0 NodeJS : v10.9.0 (/usr/local/bin/node) npm : 6.9.0 OS : macOS Mojave Xcode : Xcode 10.2 Build version 10E125
Same problem here, my env is just like yours.
Same issue after updating to Xcode 10.2
Edit: Downgraded to 10.1 with same issue.
If I run xcrun simctl list
it gives me all the simulators installed.
If I run ios-sim showdevicetypes
it gives me nothing.
If I run ionic cordova emulate ios -l -- --buildFlag='-UseModernBuildSystem=0' --target='iPad-Air-2, 12.1'
then it gives me: Device id for device name "iPad Air 2" and runtime "iOS 12.1" could not be found, or is not available.
If I run it from Xcode then it opens up fine.
I used Xcode 10.2 and 10.1 and tried various different versions of: "cordova": "^9.0.0", "cordova-ios": "^5.0.0", "ios-sim": "^9.0.0-dev.1",
Has anyone been able to find a work-around until this gets fixed?
@crabbydavis Run app from Xcode - this is works fine for now.
I'm working on a couple apps right now and one of them works when I run it from Xcode but the other one isn't pulling in any data. The service is throwing 200s as errors. Maybe it's just an issue with my api. Thanks @valeriy-kovalev
@valeriy-kovalev @crabbydavis I don't think XCode allows for livereload when you run it from there. Maybe I'm wrong but that's my understanding.
Best workaround for me has been to use a device instead of an emulator. Plug device in and use 'run' instead of 'emulate' and this allows livereload if needed.
@bbb81 cordova needs to update to the latest ios-sim. Which is unreleased as of yet until this Xcode 10.2 issue is resolved
@ewwwgiddings can you show your ios-sim version ios-sim --version
since you didn't get any listing from showdevicetypes
Workaround, try in the root of your cordova app after each time the ios
platform is added:
cd platforms/ios
npm install ios-sim@next
Sorry the workaround will not work, because of: https://github.com/apache/cordova-ios/issues/567 I'll work on that after this issue is resolved
@shazron I'm a bit confused. I thought I've seen you mention to install ios-sim@next in multiple threads on here, but the issue you just linked to you said don't upgrade to ios-sim 9 which is @next
I'll check the --version of ios-sim tomorrow but until then my package.json is at "ios-sim": "^9.0.0-dev.1"
What are you suggesting I do? Sorry I'm confused right now...
I only released ios-sim@next for those that wanted the latest code now (next is a pre-release, a release candidate if you will). There hasn't been a formal release because it is not ready yet as I already explained in previous comments.
@shazron, so WHEN it's done, we can use the ios-sim@9.0.0 with cordova CLI 9.0.0 (that will brings the ios-cordova@5.0.0), and xCode 10.2, right?
I tried to open it with a empty new project and I'm having this error message iossim.getdevicetypes is not a function
This my ionic info
output
Ionic:
ionic (Ionic CLI) : 4.3.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.3
@ionic/app-scripts : 3.2.1
Cordova:
cordova (Cordova CLI) : 9.0.0
Cordova Platforms : ios 5.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)
System:
ios-deploy : 1.9.4
ios-sim : ios-sim/9.0.0-dev.1 darwin-x64 node-v11.1.0
NodeJS : v11.1.0 (/usr/local/Cellar/node/11.1.0/bin/node)
npm : 6.9.0
OS : macOS
Xcode : Xcode 10.2 Build version 10E125
@mf222 use showdevicetypes not getdevicetypes
@ewwwgiddings thanks, but I think I didn't explain myself well, I wasn't trying to run ios-sim showdevicetypes
. When I make ionic emulate ios
with the specs I mentioned, the script fails with the following error: iossim.getdevicetypes is not a function
.
@jeansantana yes
@mf222 see my comment previously where I referenced a cordova-ios issue, this is the issue you are getting.
@shazron you're confusing me. You told me not to use 9.0 because the only way to get 9.0 is by using ios-sim@next, but now you have just said to @jeansantana to use 9.0 and it is done? Am I missing something?
@ewwwgiddings I think what jeansantana is saying is "when it's done" at least that's how I read it
@shazron Thanks for your effort to fix this! :)
Your quick fix along with ios-sim 8.0.0 and available_runtimes[ runtime.identifier] = (runtime.availability === '(available)'); seems to resolve issues with console auto starting (emulating) iOS devices.
However I am now experiencing issue that Safari Web inspector does not get debuggable code. Safari recognizes application and ionic web server instance as runnable, however when you click on it you get empty web inspector.
Am I missing something? Thanks for help!
Ok I've published a new ios-sim@next version that is cordova compatible, however cordova run ios --emulator
has an error, but you can do cordova run --list
For the workaround, try in the root of your cordova app after each time the ios
platform is added:
cd platforms/ios
npm install ios-sim@next
If people can test with that, that will be good.
@Adza93 no idea yet, will get to it after
Others: needless to say this release is not complete yet, I have yet to still debug start, install, launch
@shazron I have managed to understand what is going on with iOS 12.2 and Web debugger in Safari (generally debugging).
It looks like latest Safari 12.0.3 (14606.4.5) is not in sync with iOS 12.2 Web components needed to establish debugger connection to web server.
When I try to debug simulators or real devices with iOS version lower than 12.2 (Tried on iOS 11 and 12.0.X) debugging works.
Current solution for iOS 12.2 is to use Safari Technology Preview (Release 78 (Safari 12.2, WebKit 14608.1.9.1)), where Web debugging works as it should. Other solution is not to use iOS 12.2 Simulators and stick with Safari.
@shazron Just installed the latest ios-sim@next but I'm not getting any available virtual ios devices when I run cordova run --list. Here's my ionic info
Ionic: ionic (Ionic CLI) : 4.1.1 Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0
Cordova: cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 8.0.0, ios 5.0.0 Cordova Plugins : cordova-plugin-ionic-webview 3.1.2, (and 37 other plugins)
System: ios-deploy : 1.9.4 ios-sim : ios-sim/9.0.0-dev.2 darwin-x64 node-v10.9.0 NodeJS : v10.9.0 (/Users/crabbydavis/.nvm/versions/node/v10.9.0/bin/node) npm : 6.4.1 OS : macOS Xcode : Xcode 10.2 Build version 10E125
Hi, With the workaround install, I was able to get the list of devices by invoking: `cordova run --list
Available ios devices: Available ios virtual devices: ios-sim.getdevicetypes is deprecated, use ShowDeviceTypesCommand instead. Apple-Watch-38mm, watchOS 3.2 Apple-Watch-38mm, watchOS 4.2 Apple-Watch-42mm, watchOS 3.2 Apple-Watch-42mm, watchOS 4.2 Apple-Watch-Series-2-38mm, watchOS 3.2 Apple-Watch-Series-2-38mm, watchOS 4.2 Apple-Watch-Series-2-38mm, watchOS 5.2 Apple-Watch-Series-2-42mm, watchOS 3.2 Apple-Watch-Series-2-42mm, watchOS 4.2 Apple-Watch-Series-2-42mm, watchOS 5.2 Apple-Watch-Series-3-38mm, watchOS 4.2 Apple-Watch-Series-3-38mm, watchOS 5.2 Apple-Watch-Series-3-42mm, watchOS 4.2 Apple-Watch-Series-3-42mm, watchOS 5.2 Apple-Watch-Series-4-40mm, watchOS 5.2 Apple-Watch-Series-4-44mm, watchOS 5.2 iPhone-5s, 11.3 iPhone-5s, 12.2 iPhone-5s, 10.0 iPhone-5s, 9.0 iPhone-6, 11.3 iPhone-6, 12.2 iPhone-6, 10.0 iPhone-6, 9.0 iPhone-6-Plus, 11.3 iPhone-6-Plus, 12.2 iPhone-6-Plus, 10.0 iPhone-6-Plus, 9.0 iPhone-6s, 11.3 iPhone-6s, 12.2 iPhone-6s, 10.0 iPhone-6s, 9.0 iPhone-6s-Plus, 11.3 iPhone-6s-Plus, 12.2 iPhone-6s-Plus, 10.0 iPhone-6s-Plus, 9.0 iPhone-7, 11.3 iPhone-7, 12.2 iPhone-7-Plus, 11.3 iPhone-7-Plus, 12.2 iPhone-8, 11.3 iPhone-8, 12.2 iPhone-8-Plus, 11.3 iPhone-8-Plus, 12.2 iPhone-SE, 11.3 iPhone-SE, 12.2 iPhone-SE, 10.0 iPhone-X, 11.3 iPhone-X, 12.2 iPad-Air, 11.3 iPad-Air, 12.2 iPad-Air, 10.0 iPad-Air, 9.0 iPad-Air-2, 11.3 iPad-Air-2, 12.2 iPad-Air-2, 10.0 iPad-Air-2, 9.0 iPad--5th-generation-, 11.3 iPad--5th-generation-, 12.2 iPad-Pro--9-7-inch-, 11.3 iPad-Pro--9-7-inch-, 12.2 iPad-Pro, 11.3 iPad-Pro, 12.2 iPad-Pro--12-9-inch---2nd-generation-, 11.3 iPad-Pro--12-9-inch---2nd-generation-, 12.2 iPad-Pro--10-5-inch-, 11.3 iPad-Pro--10-5-inch-, 12.2 Apple-TV-1080p, tvOS 10.0 Apple-TV-1080p, tvOS 12.2 Apple-TV-1080p, tvOS 11.3 iPhone-XS, 12.2 iPhone-XS-Max, 12.2 iPad--6th-generation-, 12.2 iPad-Pro--11-inch-, 12.2 iPad-Pro--12-9-inch---3rd-generation-, 12.2 iPhone-XR, 12.2 iPad-Air--3rd-generation-, 12.2 iPhone-5, 10.0 iPhone-5, 9.0 iPad-Pro--9-7-inch-, 10.0 iPad-Pro, 10.0 Apple-TV-4K-4K, tvOS 12.2 Apple-TV-4K-4K, tvOS 11.3 Apple-TV-4K-1080p, tvOS 12.2 Apple-TV-4K-1080p, tvOS 11.3 iPhone-4s, 9.0 iPad-2, 9.0 iPad-Retina, 9.0 Apple-Watch-38mm, watchOS 3.2 Apple-Watch-38mm, watchOS 4.2 Apple-Watch-42mm, watchOS 3.2 Apple-Watch-42mm, watchOS 4.2 Apple-Watch-Series-2-38mm, watchOS 3.2 Apple-Watch-Series-2-38mm, watchOS 4.2 Apple-Watch-Series-2-38mm, watchOS 5.2 Apple-Watch-Series-2-42mm, watchOS 3.2 Apple-Watch-Series-2-42mm, watchOS 4.2 Apple-Watch-Series-2-42mm, watchOS 5.2 Apple-Watch-Series-3-38mm, watchOS 4.2 Apple-Watch-Series-3-38mm, watchOS 5.2 Apple-Watch-Series-3-42mm, watchOS 4.2 Apple-Watch-Series-3-42mm, watchOS 5.2 Apple-Watch-Series-4-40mm, watchOS 5.2 Apple-Watch-Series-4-44mm, watchOS 5.2 iPhone-5s, 11.3 iPhone-5s, 12.2 iPhone-5s, 10.0 iPhone-5s, 9.0 iPhone-6, 11.3 iPhone-6, 12.2 iPhone-6, 10.0 iPhone-6, 9.0 iPhone-6-Plus, 11.3 iPhone-6-Plus, 12.2 iPhone-6-Plus, 10.0 iPhone-6-Plus, 9.0 iPhone-6s, 11.3 iPhone-6s, 12.2 iPhone-6s, 10.0 iPhone-6s, 9.0 iPhone-6s-Plus, 11.3 iPhone-6s-Plus, 12.2 iPhone-6s-Plus, 10.0 iPhone-6s-Plus, 9.0 iPhone-7, 11.3 iPhone-7, 12.2 iPhone-7-Plus, 11.3 iPhone-7-Plus, 12.2 iPhone-8, 11.3 iPhone-8, 12.2 iPhone-8-Plus, 11.3 iPhone-8-Plus, 12.2 iPhone-SE, 11.3 iPhone-SE, 12.2 iPhone-SE, 10.0 iPhone-X, 11.3 iPhone-X, 12.2 iPad-Air, 11.3 iPad-Air, 12.2 iPad-Air, 10.0 iPad-Air, 9.0 iPad-Air-2, 11.3 iPad-Air-2, 12.2 iPad-Air-2, 10.0 iPad-Air-2, 9.0 iPad--5th-generation-, 11.3 iPad--5th-generation-, 12.2 iPad-Pro--9-7-inch-, 11.3 iPad-Pro--9-7-inch-, 12.2 iPad-Pro, 11.3 iPad-Pro, 12.2 iPad-Pro--12-9-inch---2nd-generation-, 11.3 iPad-Pro--12-9-inch---2nd-generation-, 12.2 iPad-Pro--10-5-inch-, 11.3 iPad-Pro--10-5-inch-, 12.2 Apple-TV-1080p, tvOS 10.0 Apple-TV-1080p, tvOS 12.2 Apple-TV-1080p, tvOS 11.3 iPhone-XS, 12.2 iPhone-XS-Max, 12.2 iPad--6th-generation-, 12.2 iPad-Pro--11-inch-, 12.2 iPad-Pro--12-9-inch---3rd-generation-, 12.2 iPhone-XR, 12.2 iPad-Air--3rd-generation-, 12.2 iPhone-5, 10.0 iPhone-5, 9.0 iPad-Pro--9-7-inch-, 10.0 iPad-Pro, 10.0 Apple-TV-4K-4K, tvOS 12.2 Apple-TV-4K-4K, tvOS 11.3 Apple-TV-4K-1080p, tvOS 12.2 Apple-TV-4K-1080p, tvOS 11.3 iPhone-4s, 9.0 iPad-2, 9.0 iPad-Retina, 9.0`
However, when attempting to use the run command for my ionic project with:
ionic cordova run --target="iPhone-X
There is an issue as follow: `... BUILD SUCCEEDED
Command finished with error code 0: xcodebuild -workspace,Quizionic4.xcworkspace,-scheme,Quizionic4,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/flavio/Quizionic4/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/flavio/Quizionic4/platforms/ios/build/sharedpch,-UseModernBuildSystem=0 No scripts found for hook "before_deploy". Error: spawn /Users/flavio/Quizionic4/node_modules/ios-sim/src/bin/ios-sim ENOENT [ERROR] An error occurred while running subprocess cordova.
cordova run ios --verbose --target iPhone-X exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: process.exit received +0ms ionic:utils-process onBeforeExit handler: running 2 functions +0ms ionic:utils-process onBeforeExit handler: exiting (exit code 1) +25ms`
Any idea?
@fpassa can you post your ionic info?
Tried with the npm install ios-sim@next
and got the following error:
No target specified for emulator. Deploying to iPhone-XR, 12.2 simulator
Error: spawn /Users/alex/Take5/etraining-vue/src-cordova/node_modules/ios-sim/src/bin/ios-sim ENOENT
Going to the folder i checked that the src doesn't have any bin folder inside. The above folder has a bin in it. I tried to copy it to the src folder and the error was gone, but the emulator never starts.
run from xCode, It takes a few days to fix this :/ (the prev xcode version same problem).
me try solve this in the prev version of xcode:
reinstall xcode reinstall ionic reinstall node reinstall cordova
Nothing worked. so sad
Running on real device is fine, but not on emulator.
@fpassa @alexpvieira yes, i mentioned that starting the emulator will not work in my comment https://github.com/ios-control/ios-sim/issues/253#issuecomment-477923851
I'm writing tests as I go along, so that's why it's taking longer. The previous versions did not have tests.
I don't know if this helps but the RN community ran into the same issue. I don't know how ios-sim handles this but thought I would share some of their discussion on the issue. https://github.com/react-native-community/react-native-cli/pull/138
... debugging with command line "iOS-sim start -d="iPhone-X" with ios-sim@next
helpers.js line 248: ret_obj.runtime has value => "iOS 12.2" list.devices has values starting with com.apple.CoreSimulator...
so it will not match any of those values...
... passing the runtime explicitly in this form seems to do the trick:
ios-sim start -d=iPhone-X,com.apple.CoreSimulator.SimRuntime.iOS-12-2
thanks! - yes there are several places in the code where we need to do fixDeviceGroup
, I have been fixing them as I find them
For the people looking for a quick fix to emulate with livereload : https://forum.ionicframework.com/t/ios-sim-does-not-recognize-devices-after-xcode-10-2-update/160276/2?u=rboutaleb
Works perfect !
This works for me. Change the target and debug/release build type to suit your needs.
cordova emulate ios --debug --target "iPhone-X,com.apple.CoreSimulator.SimRuntime.iOS-12-2" --buildFlag='-UseModernBuildSystem=0'
Ok I've published a new ios-sim@next version (dev.4) that is fully cordova compatible. I tested:
$ cordova run --list
$ cordova run ios --emulator --target "iPhone-X, 12.2"
$ cordova emulate ios --target "iPhone-X, 12.2"
For the workaround, try in the root of your cordova app after each time the ios
platform is added:
cd platforms/ios
npm install ios-sim@next
If people can test with that, that will be good. I've tested all the commands with ios-sim stand-alone, seems ok. I still need to complete 100% coverage of the tests.
@shazron it is not working for me. I have updated ios-sim to latest @next.
I get the error message Device id for device name "iPhone 7" and runtime "iOS 12.2" could not be found, or is not available. [ERROR] An error occurred while running cordova run ios --target "iPhone-7, 12.2" (exit code 1).
when I run ionic cordova run --list i get empty list Available ios devices:
But when I try ios-sim showdevicetypes i get regular list Apple-TV-1080p, tvOS 12.2 Apple-TV-4K-4K, tvOS 12.2 Apple-TV-4K-1080p, tvOS 12.2 ..... ... ...... iPhone-5s, 11.4
My ionic info
` @ionic/cli-utils : 1.19.3 ionic (Ionic CLI) : 3.20.1
global packages:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
local packages:
@ionic/app-scripts : 3.2.0
Cordova Platforms : android 6.4.0 ios 4.3.1
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.4
ios-sim : ios-sim/9.0.0-dev.4 darwin-x64 node-v10.13.0
Node : v10.13.0
npm : 6.4.1
OS : macOS
Xcode : Xcode 10.2 Build version 10E125
Environment Variables: `
Based on previous answered, I succeed in launching my app on an iPad with this command
cordova run ios --target="iPad-Air-2,com.apple.CoreSimulator.SimRuntime.iOS-12-2" --buildFlag="-UseModernBuildSystem=0"
@devsontx Have you gotten live reload to work?
with my Ionic 3 project:
ionic cordova run ios -l -c -s --target="iPhone-X,com.apple.CoreSimulator.SimRuntime.iOS-12-2" -- --buildFlag="-UseModernBuildSystem=0"
works fine... I'm using ios-sim 8 though
Going down from ios-sim 9.0.0-dev.4 to 8 was the trick to get live reload working for me again. Thanks @leonardomontes !!
... although live-reload seems to work, I'm experiencing issues with it:
1) Developer Tools Inspector doesn't show any code / html / css...
... anyone else experiencing this?
Going to try and downgrade XCode...
@Adza93 Hmm, I get the right info. Did you install ios-sim according to my instructions, how did you install it? what does xcrun simctl list --json
show?
Note that I can only test on Cordova, not Ionic.
If it was installed properly for Cordova, the first three lines should be this (assuming you don't have a device connected):
Available ios devices:
Available ios virtual devices:
ios-sim.getdevicetypes is deprecated, use ShowDeviceTypesCommand instead.
@shazron
I did upgrade of ios-sim@next at the root location of the project. After your comment I also did following steps
cd platforms/ios npm install ios-sim@next
But it did not help.
output for xcrun simctl list --json
@shazron one more info, it works when i specify new naming convenction of CoresimulatorRuntime
so this command starts simulator as it should ionic cordova run ios -l -c -s --target="iPhone-X,com.apple.CoreSimulator.mRuntime.iOS-12-2" -- --buildFlag="-UseModernBuildSystem=0"
but ios-sim showdevicetypes returns old "preffered" naming:
Aleksandars-MacBook-Pro-PETROL:mBillsIonic aleksandaradzic$ ios-sim showdevicetypes Apple-TV-1080p, tvOS 12.2 Apple-TV-4K-4K, tvOS 12.2 Apple-TV-4K-1080p, tvOS 12.2 iPhone-5s, 11.4 iPhone-5s, 12.2 iPhone-6, 11.4 iPhone-6, 12.2 iPhone-6-Plus, 11.4 iPhone-6-Plus, 12.2 iPhone-6s, 11.4 iPhone-6s, 12.2 iPhone-6s-Plus, 11.4 iPhone-6s-Plus, 12.2 iPhone-7, 11.4 iPhone-7, 12.2 iPhone-7-Plus, 11.4 .....
Am I still missing something?
Just to confirm that @leonardomontes workaround did the job for me too, so I can continue using the stable ios-sim version.
@Adza93 yes, the proper @next version of ios-sim was not installed properly. I assure you this issue has been fixed in @next, it's probably an npm issue not installing it properly. Try npm uninstall ios-sim
before installing it to see if it makes a difference. You should see the deprecation notice when running cordova run --list
if it was installed properly. Try also to verify that the version of ios-sim in platforms/ios/node_modules
is correct.
ios-sim showdevicetypes
, if you installed ios-sim@next
globally using the -g
flag, should report the correct values as well.
See related #234