Skip to content

Error When Run on Simulator/Emulator in iOS Only. #3324

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

Closed
pawankv89 opened this issue Jan 18, 2018 · 6 comments
Closed

Error When Run on Simulator/Emulator in iOS Only. #3324

pawankv89 opened this issue Jan 18, 2018 · 6 comments

Comments

@pawankv89
Copy link

Hello my friends,

My Project working fine when connected by real iOS device and Android Emulator But I am not able to run on iOS Simulator(Emulator).

pawankumar$ tns info
All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬─────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.4.1 │ 3.4.1 │ Up to date │
│ tns-core-modules │ 3.4.0 │ 3.4.0 │ Up to date │
│ tns-android │ 3.4.1 │ 3.4.1 │ Up to date │
│ tns-ios │ 3.4.1 │ 3.4.1 │ Up to date │
└──────────────────┴─────────────────┴────────────────┴─────────────┘
When run this command pawankumar$ tns run ios --emulator
but not install App in Simulator.

@dtopuzov
Copy link
Contributor

Hi @pawankv89 can you please specify:

  • Xcode version
  • macOS version

Please also run this command xcrun simctl list devices and make sure it list some emulators.

@pawankv89
Copy link
Author

Thanks @dtopuzov for reply,

Xcode version Xcode 9.0
macOS version macOSSierra Version 10.12.6

pawankumar$ xcrun simctl list devices
== Devices ==
-- iOS 11.0 --
iPhone 5s (E2E07E74-48A2-4D2D-AB0A-03914A1BF3D2) (Shutdown)
iPhone 6 (4E47FFF3-4FBA-48F4-926A-7E3F082195D8) (Shutdown)
iPhone 6 Plus (BE315AE4-D32A-4150-9DA0-4A282C48D06F) (Shutdown)
iPhone 6s (446EE7FE-4CD8-4CE4-B2CC-5499BE32A838) (Shutdown)
iPhone 6s Plus (39D23495-3BE6-4A48-9EB9-7C70A7295E33) (Shutdown)
iPhone 7 (B19230FC-49B5-4F0B-9A70-0D97EEF65A2C) (Shutdown)
iPhone 7 Plus (4F5DEB71-825D-4AC3-BEE0-8F17DA22044B) (Shutdown)
iPhone SE (8C3B17E3-B359-4811-8624-FCE45FFEDC4F) (Shutdown)
iPhone 8 (9105506D-39A1-4CB2-956D-EA72DDEBF57B) (Shutdown)
iPhone 8 Plus (0C3D1554-AED4-4FB3-968B-2621C9C5C6D2) (Shutdown)
iPad Air (36FCB989-DC67-4D49-BE7B-31E624C30BA6) (Shutdown)
iPad Air 2 (9BD63C1E-CDD7-457F-9690-8460E515B791) (Shutdown)
iPad (5th generation) (0C3DEE87-551B-40AC-93C5-B419DADF1F1C) (Shutdown)
iPad Pro (9.7-inch) (F3CE1A03-EF7D-44FF-B7D3-B27710A86D2E) (Shutdown)
iPad Pro (12.9-inch) (AB401ECB-2ADF-4E3E-B1FF-5DD4177D4E66) (Shutdown)
iPad Pro (12.9-inch) (2nd generation) (EE38F9EF-4094-4E4E-9D2A-757018DA0FA9) (Shutdown)
iPad Pro (10.5-inch) (0E72D5D9-2305-4F55-AC07-9EB0A2A86138) (Shutdown)
-- tvOS 11.0 --
Apple TV (6EBCBFAF-3340-4010-A621-8203E75F23B5) (Shutdown)
Apple TV 4K (2FCF79AF-CA33-4E19-A738-E575A0625894) (Shutdown)
Apple TV 4K (at 1080p) (267EACB8-409E-464C-A0A2-DC4FD2BAD4D7) (Shutdown)
-- watchOS 4.0 --
Apple Watch - 38mm (4B1D156A-A93D-421D-B8A1-E5A2F335B701) (Shutdown)
Apple Watch - 42mm (D33CE215-DBD9-4730-8192-620E50197A40) (Shutdown)
Apple Watch Series 2 - 38mm (B1D94FE8-C1FB-4F7B-90C8-321835D9AC07) (Shutdown)
Apple Watch Series 2 - 42mm (CE064F23-B9F6-452B-967C-BD66E352E9CE) (Shutdown)
Apple Watch Series 3 - 38mm (741C81C4-B860-47DF-B056-8456056AEBA6) (Shutdown)
Apple Watch Series 3 - 42mm (A43D377B-44C4-4E7A-BC13-B0E3F795363B) (Shutdown)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-11-2 --
iPhone 5s (980A760A-4675-48C0-BFCA-1B7EACD78EA2) (Shutdown) (unavailable, runtime profile not found)
iPhone 6 (2AB71A8D-0375-4A49-88F1-8962C72FF52C) (Shutdown) (unavailable, runtime profile not found)
iPhone 6 Plus (B64F8C38-3B63-4F22-86A7-DE7DE29DAFC9) (Shutdown) (unavailable, runtime profile not found)
iPhone 6s (560FCEBF-6539-424C-924A-1256DD1EBA79) (Shutdown) (unavailable, runtime profile not found)
iPhone 6s Plus (A8260850-5373-462E-A186-3C665941756C) (Shutdown) (unavailable, runtime profile not found)
iPhone 7 (99191663-34E2-4873-927F-E3D33E49FD81) (Shutdown) (unavailable, runtime profile not found)
iPhone 7 Plus (1C683EB9-AAE6-47F8-9BDE-2A301A7BA8C7) (Shutdown) (unavailable, runtime profile not found)
iPhone SE (6CF40E09-6691-4151-A032-66AB00C41D5A) (Shutdown) (unavailable, runtime profile not found)
iPhone 8 (7BA0EF9B-A75E-49DD-ABB5-BF542E5AC375) (Shutdown) (unavailable, runtime profile not found)
iPhone 8 Plus (14D1B32A-F115-4B92-AD0E-8E8BA26331DB) (Shutdown) (unavailable, runtime profile not found)
iPhone X (4A606699-EA86-4AFD-B95A-F09420540DA7) (Shutdown) (unavailable, runtime profile not found)
iPhone X (C5A11049-74DC-4982-9206-04289A582513) (Shutdown) (unavailable, runtime profile not found)
iPad Air (B4E2CCA9-7041-48BC-A504-30F36B8484E6) (Shutdown) (unavailable, runtime profile not found)
iPad Air 2 (7642F341-4C5F-4835-99E6-89D533AAEBD3) (Shutdown) (unavailable, runtime profile not found)
iPad (5th generation) (76D223D6-B835-40A5-B767-445876D4CFA6) (Shutdown) (unavailable, runtime profile not found)
iPad Pro (9.7-inch) (8CC5DEDB-A528-4D35-B07F-CFF8F43FAB5A) (Shutdown) (unavailable, runtime profile not found)
iPad Pro (12.9-inch) (B8F6CBCD-A2C1-4AD9-A7D4-14C96B4504E2) (Shutdown) (unavailable, runtime profile not found)
iPad Pro (12.9-inch) (2nd generation) (D6496F91-2BEF-4087-A756-B277DD6B4522) (Shutdown) (unavailable, runtime profile not found)
iPad Pro (10.5-inch) (8498AFAE-0099-42E7-BDA4-DF6D47207F2A) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.tvOS-11-2 --
Apple TV (634624A2-8DEF-457F-AA7E-0020A01C9625) (Shutdown) (unavailable, runtime profile not found)
Apple TV 4K (114F933B-EE66-4A73-A6AE-D2C67C6B2D98) (Shutdown) (unavailable, runtime profile not found)
Apple TV 4K (at 1080p) (23755429-895A-4D93-93AE-1485A252F042) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.watchOS-4-2 --
Apple Watch - 38mm (29C89001-9FC4-4EEE-BAF8-61012103003E) (Shutdown) (unavailable, runtime profile not found)
Apple Watch - 42mm (98C0DAD5-6163-403D-8EEF-378888644468) (Shutdown) (unavailable, runtime profile not found)
Apple Watch Series 2 - 38mm (D85730D0-208B-4038-9CC7-6493A7A55D7C) (Shutdown) (unavailable, runtime profile not found)
Apple Watch Series 2 - 42mm (E9AD04AD-3E4B-484D-A226-7B7C09F9ABD1) (Shutdown) (unavailable, runtime profile not found)
Apple Watch Series 3 - 38mm (F14504BA-8619-4BEE-88FC-8D41359EF6F4) (Shutdown) (unavailable, runtime profile not found)
Apple Watch Series 3 - 42mm (F005BB65-3517-4819-A8AD-A80AEC4BB122) (Shutdown) (unavailable, runtime profile not found)

@sarojrout
Copy link

am also facing the same issue. I was able to run my application only once in the simulator. next time onwards, the app is not coming up.

@dtopuzov
Copy link
Contributor

Hi @sarojrout I believe you experience different kind of problem.

I think the original reported issue is that tns can not find available iOS simulators.
In your case it obviously finds them (since you run can run it once), so it should be an issue with livesync.

Can you please open separate issue and provide as much info as you can:

  • Steps to reproduce
  • Does it happens on both JS and NG projects.
  • Does it happens also on Android emulators.
  • Do you see some errors/warning in console log.

@tsonevn
Copy link
Contributor

tsonevn commented Jan 24, 2018

Log trace output:

Looking for project in '/Users/ntsonev/Downloads/test40'
Project directory is '/Users/ntsonev/Downloads/test40'.
Exec which xcodebuild 
 stdout: /usr/bin/xcodebuild
 
 stderr: 
Exec xcodebuild -version | head -n 1 | sed -e 's/Xcode //' 
 stdout: 9.2
 
 stderr: 
Validate options for platform: iOS
Initializing analytics statuses.
Analytics statuses:  { TrackFeatureUsage: 'disabled', TrackExceptions: 'disabled' }
Searching for devices...
startLookingForDevices; platform is iOS
Starting to look for iOS devices.
Exec ps cax | grep launchd_sim 
 stdout:  
 stderr: 
Exec ps cax | grep launchd_sim 
 stdout:  
 stderr: 
startLookingForDevices; platform is iOS
Exec ps cax | grep launchd_sim 
 stdout:  
 stderr: 
Exec ps cax | grep launchd_sim 
 stdout:  
 stderr: 
Unable to find applicable devices to execute operation. Ensure connected devices are trusted and try again.
Error: Unable to find applicable devices to execute operation. Ensure connected devices are trusted and try again.
    at Errors.fail (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:125:28)
    at Errors.failWithoutHelp (/usr/local/lib/node_modules/nativescript/lib/common/errors.js:134:21)
    at LiveSyncCommandHelper.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/services/livesync/livesync-command-helper.js:32:34)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/nativescript/lib/services/livesync/livesync-command-helper.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/nativescript/lib/services/livesync/livesync-command-helper.js:3:12)
    at LiveSyncCommandHelper.executeLiveSyncOperation (/usr/local/lib/node_modules/nativescript/lib/services/livesync/livesync-command-helper.js:29:16)
    at RunCommandBase.<anonymous> (/usr/local/lib/node_modules/nativescript/lib/commands/run.js:76:47)
    at Generator.next (<anonymous>)
IOSDeviceOperations disposed.

This happens with Simulator app is running, but there is no booted simulator.

EDIT
Steps for reproducing:

  1. create new NativeScritp project tns create testApp

  2. close any iOS simulators while using X button;
    screencast 2018-01-25 at 11 13 11 am

  3. try running the project with tns run ios
    as a result, the above error will be thrown.

Solution:

To resolve the issue you just need to quit the simulator and to run again tns run ios.

screencast 2018-01-25 at 11 19 16 am

Fatme added a commit to NativeScript/ios-sim-portable that referenced this issue Feb 15, 2018
@Fatme Fatme self-assigned this Feb 15, 2018
@Fatme Fatme added this to the 4.0.0 milestone Feb 15, 2018
@Fatme
Copy link
Contributor

Fatme commented Feb 15, 2018

Thanks guys for reporting this problem.

I've fixed it and the fix will be included in the next official release.

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

No branches or pull requests

6 participants