Simulator

RSS for tag

Rapidly prototype and test builds of your app during the development process using Simulator.

Simulator Documentation

Pinned Posts

Posts under Simulator tag

361 Posts
Sort by:
Post not yet marked as solved
0 Replies
65 Views
I have a sample iOS app in Xcode that I run in the iOS 17.5 Simulator. It creates a WKWebView and configures a proxy via the ProxyConfiguration API, it works as expected unless the proxy tries to establish mTLS. It seems there is no way to handle the client certificate request when using a proxy. If I navigate to a page that requests mTLS without a proxy configured, it works as expected. Here is a minimal repro: #import "ViewController.h" #import <WebKit/WebKit.h> @import Foundation; @import WebKit; @interface ViewController () <WKNavigationDelegate> @property (nonatomic,strong) WKWebView* webView; @property (nonatomic, strong) WKWebViewConfiguration * webConfig; @end @implementation ViewController - (void)loadView { [super loadView]; nw_protocol_options_t tls_options = nw_tls_create_options(); sec_protocol_options_t sec_options = nw_tls_copy_sec_protocol_options(tls_options); sec_protocol_options_set_challenge_block( sec_options, ^(sec_protocol_metadata_t metadata, sec_protocol_challenge_complete_t challenge_complete) { NSLog(@"Inside of challenge block"); challenge_complete(nil); }, dispatch_get_main_queue()); nw_endpoint_t proxy_endpoint = nw_endpoint_create_host(GetHost(), GetPort()); nw_relay_hop_t relay = nw_relay_hop_create(nil, proxy_endpoint, tls_options); nw_proxy_config_t proxy_config = nw_proxy_config_create_relay(relay, nil); nw_proxy_config_add_match_domain(proxy_config, "api.ipify.org"); self.webConfig = [[WKWebViewConfiguration alloc] init]; self.webConfig.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore]; self.webConfig.websiteDataStore.proxyConfigurations = @[ proxy_config ]; self.webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:self.webConfig]; self.webView.navigationDelegate = self; [self.view addSubview:self.webView]; } - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"%s",__func__); NSURL* url = [[NSURL alloc] initWithString:@"https://api.ipify.org"]; NSURLRequest* request = [[NSURLRequest alloc] initWithURL:url]; [self.webView loadRequest:request]; } - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation { NSLog(@"%s",__func__); } - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error { NSLog(@"%s. Error %@",__func__,error); } - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler { NSLog(@"%s",__func__); NSLog(@"protection space: %@", challenge.protectionSpace.authenticationMethod); completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil); } @end The logs for this code show: -[ViewController viewDidLoad] -[ViewController webView:didStartProvisionalNavigation:] -[ViewController webView:didFailProvisionalNavigation:withError:]. Error Error Domain=NSURLErrorDomain Code=-1206 "The server “api.ipify.org” requires a client certificate." If we don't set up the ProxyConfiguration and navigate to a site that requires mTLS, the logs look like this: -[ViewController viewDidLoad] -[ViewController webView:didReceiveAuthenticationChallenge:completionHandler:] protection space: NSURLAuthenticationMethodServerTrust -[ViewController webView:didReceiveAuthenticationChallenge:completionHandler:] protection space: NSURLAuthenticationMethodClientCertificate -[ViewController webView:didStartProvisionalNavigation:] //... Eventually the request fails but the key difference is that didReceiveAuthenticationChallenge was invoked. When using the ProxyConfiguration neither that function nor the block we set via sec_protocol_options_set_challenge_block were run. I also tried to provide the client identity via sec_protocol_options_set_local_identity to no avail, and I've tried configuring these options too but they had no effect sec_protocol_options_add_tls_application_protocol(sec_options, "h2"); sec_protocol_options_set_max_tls_protocol_version(sec_options, tls_protocol_version_TLSv13); sec_protocol_options_set_peer_authentication_required(sec_options, true); Am I missing something? Or is this a bug in the ProxyConfiguration API?
Posted
by auorion.
Last updated
.
Post not yet marked as solved
0 Replies
58 Views
Hello fellow developers, We are trying to develop a chatbot application for ios devices using the powers of Oracle Digital Assistant. Main Documentation :- https://docs.oracle.com/en/cloud/paas/digital-assistant/use-chatbot/oracle-ios.html Implementation instructions :- https://blogs.oracle.com/digitalassistant/post/oracle-techexchange-using-the-oracle-ios-sdk-to-integrate-oracle-digital-assistant-in-mobile-applications The point is when we are trying to run the app, we are facing tons of warnings as in below screenshot. Here is the code for the ViewController.swift as below: // // ViewController.swift // ODA_Configure // // Created by Macbook on 15/05/24. // //import UIKit // //class ViewController: UIViewController { // // override func viewDidLoad() { // super.viewDidLoad() // // Do any additional setup after loading the view. // } // // //} // Import the SDK import UIKit import BotClientUISDK public class ViewController: UIViewController { // Declare a global BotsViewController variable in your app view controller class public var chatViewController: BotsViewController? public override func viewDidLoad() { super.viewDidLoad() // Obtain a shared instance of BotsViewController from BotsUIManager chatViewController = BotsUIManager.shared().viewControllerInstance() // Specify the color changes if any in a particular component. Make sure you set all the required colors in BotsProperties before adding the chat view to the view controller. // Add the chatViewController to your navigationController self.navigationController?.pushViewController(chatViewController!, animated: false) // Obtain a shared instance of BotsManager let botsManager = BotsManager.shared() // If you require access to callback methods provided in AuthenticationProvider. Make sure your class conforms to BotsMessageServiceDelegate // botsManager.authenticationTokenProvider = self let baseUrl = "idcs-oda-81e5e7409d52405784089abe830a8820-da12.data.digitalassistant.oci.oraclecloud.com" let channelID = "ff8a2d3f-7d65-4dab-a09a-d8f574ce5b7a" // Initialize a BotsConfiguration object and set feature flags if required. let botsConfiguration = BotsConfiguration(url: baseUrl , channelId: channelID) BotsManager.shared().connect(botsConfiguration: botsConfiguration) // Set the feature flag values if the desired values are different from the default values botsConfiguration.showConnectionStatus = true botsConfiguration.enableSpeechSynthesis = true botsConfiguration.disablePastActions = "none" // Initialize the configuration in botsViewController. Make sure you set all the feature flag values before passing the botsConfiguration to initConfiguration. chatViewController?.initConfiguration(botsConfiguration: botsConfiguration) // If you require access to callback methods provided in BotsMessageServiceDelegate. Make sure your class conforms to BotsMessageServiceDelegate //botsManager.delegate = self // If you require access to callback methods provided in BotsEventListener. Make sure your class conforms to BotsEventListener //botsManager.botsEventListener = self // Initialize and establish connection to the chat server BotsManager.shared().initialize(botsConfiguration: botsConfiguration, completionHandler: { (connectionStatus, error) in if error != nil { print ("Error: \(String(describing: error?.localizedDescription))") } else { print ("Connection Status: \(connectionStatus)") } }) } } After executing this code, we are getting the message as build succeeded , and this is the emulator, which happens to be blank white all the time. Possibly due the warning which I have posted above this seems to be the showstopper in the development. We are developing this for a prestigious client and would request an assistance as soon as possible. P.S :- We are using Xcode 15 with Simulator of version 17.0.
Posted Last updated
.
Post not yet marked as solved
0 Replies
54 Views
I am trying to bring my iOS App to native macOS. I am using exactly the same TimelineProvider and widgets (the ones not supported on macOS surrounded by #if(os)). Running the whole app or just the WidgetExtension on iOS works perfectly fine. Running the mac app works perfectly fine apart from missing Widgets. When running the WidgetExtension on My Mac, the WidgetKit Simulator opens and only presents Failed to load widget. The operation couldn't be completed. (WidgetKit_Simulator.WidgetDocument.Error error 4.) The code compiles fine without any warnings, only a file path is printed into the console. file:///Users/myName/Library/Developer/Xcode/DerivedData/MyAppName-dfsiuexplidieybwvbkqofchxirp/Build/Products/Debug/MyApp.app/Contents/PlugIns/MyAppNameWidgetExtensionExtension.appex/ Shortly after I get a log entry Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables. I am not sure which further Informationen I can give to solve my problem. Destinations on main App and Widget Extension is both set to Mac (no suffix). The mac is running 14.4.1 and Xcode 15.3. I am really thankful for any assistance you can give me to fix this problem. Thanks
Posted
by FPST.
Last updated
.
Post not yet marked as solved
1 Replies
620 Views
Hello, im a new Apple developper since 2 years. I have Been working hard to learn and trying to publish my first IOS , iPad OS and Mac OS app. My app is taking form but I have few problems with the Xcode simulator to run ''on device'' for my iPad and iPhone. My devices began to disconnect and now I can't connect it anymore to run my code and debug. the are constantly in the state ''Trying to reconnect to '' and "preparing device". I have already reset all my device and deactivate developper mode etc. i have a iPad 7th gen and an iPhone 14 Pro Max . they both have iOS 17.5 beta 2 (trying to fix the problem by keeping those up to date as much as possible.) my Xcode version is 15.4 beta My Mac book air 13 inch 2018 is running Sonoma 14.4.1 and the is no new os version bus its not an apple M family chip. I think there is a Sonoma 14.5 beta version but for apple architecture. I really need your help plz
Posted Last updated
.
Post not yet marked as solved
1 Replies
42 Views
I am trying to embed a framework and execute it on simulator: add framework, it is required by default, make it embed-and-sign If I start the app in simulator from XCode, all runs (by default it runs under debugger, so I assume a bit different environment). If I run it directly in simulator, using xcrun simctl, it crashes with framework binary not found (is that expected?). So I experimented [quite] a bit and updated the LOAD COMMAND to load the dylib with @loader_path (default is @rpath that xcode makes) - in such case the error is: Library not loaded: @loader_path/Frameworks/***.framework/*** Referenced from: <E13560A8-7387-308A-AF0F-F5107B737910> /Users/USER/Library/Developer/CoreSimulator/Devices/47B8C2D5-F78E-4976-B124-A25623DF14A7/data/Containers/Bundle/Application/5B5EA95D-44CD-4403-BE1E-FC6851B44917/App.app/App Reason: tried: '/Users/username/Library/Developer/CoreSimulator/Devices/47B8C2D5-F78E-4976-B124-A25623DF14A7/data/Containers/Bundle/Application/5B5EA95D-44CD-4403-BE1E-FC6851B44917/App.app/Frameworks/***.framework/***' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/***.framework/***' (no such file) (terminated at launch; ignore backtrace) /Users/username/Library/Developer/CoreSimulator/Devices/47B8C2D5-F78E-4976-B124-A25623DF14A7/data/Containers/Bundle/Application/5B5EA95D-44CD-4403-BE1E-FC6851B44917/App.app/Frameworks/***.framework/*** is a local path on my dev machine, which sounds like a bug. Is that a bug? Should I open one somewhere for Apple? Then I played a bit more and found this https://stackoverflow.com/a/52535580/21881034 - "All you need to do is set the third party frameworks you are using in your custom framework for e.g:- socket.io-client-swift as Optional instead of Required under Link binary with Libraries in build Phases section" - which worked. What it does is replaces the load command with LC_LOAD_WEAK_DYLIB - so I assume it executes a bit later and probably again a different environment.
Posted Last updated
.
Post not yet marked as solved
3 Replies
481 Views
I am on a fresh install of Xcode 15.3 on macOS 14.4 (23E214). I created an iMessage App template and signed it with my personal team's certificate. When I click the run button, it successfully builds and opens the simulator to the Messages app but does not open the compact extension view (or install the extension such that it shows up in the More messages extension list). This reproduces on my older laptop (same version of Xcode) as well as my friend's (also same version of Xcode). Of note: The IceCreamBuilder app installs and runs correctly with no modifications I have not provided any icons for the messages extension The iMessage App template comes with an empty main app that does not install on the home screen The only console output that seems to differ from when I run the IceCreamBuilder is this message, which appears after a couple seconds of running the project: unhandled process MobileSMS Type: Error | Timestamp: 2024-03-09 00:41:07.763631-05:00 | Process: MobileSMS | Library: CoreParsec | Subsystem: com.apple.parsec | Category: CoreParsec | TID: 0xff097
Posted
by noahbkim.
Last updated
.
Post marked as solved
1 Replies
109 Views
I've been developing widgets for an app and have been making frequent changes to the views to try different things out. Maybe I should be using previews for this, but I've been testing on simulators and my iPhone. I've found that after some point, my code all of a sudden stops affecting the widgets on my physical iPhone and on every simulator device, even after restarts of my laptop, wipes of the simulators, etc. And I'm not able to continue development until the next day. It seems like I'm hitting the hard limit for timeline requests in a day, but I feel like that shouldn't apply to simulators or should be refreshed when reinstalling for development? Thanks.
Posted
by tillertms.
Last updated
.
Post not yet marked as solved
2 Replies
134 Views
I've recently installed x code 15.3, but when I try and open simulator I am unable to select a device. When I navigate through the top menu a few item are active. One of these (active menu item) is New Simulator: I've tried to add a new simulator. Enter a name, selected a device type, but the drop down menu for OIS Version is not populating. I am leaving paired apple watch off. When I click create nothing happens. Open Simulator is an option, but there does not list any device when the arrow is clicked. Any suggestion? Thanks, Ed.
Posted
by embNY.
Last updated
.
Post not yet marked as solved
0 Replies
391 Views
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
Posted
by edford.
Last updated
.
Post marked as Apple Recommended
1.2k Views
Hi all. I have a problem related to Xcode. Xcode says "iOS 17.2 simulator" is not installed, but I have been using this simulator for a long time and have installed the necessary SDKs. The problem has also been occurring for my colleagues since May 1, 2024. Restarting the Mac helps (there is no problem in Xcode after restarting Mac), but after reopening Xcode this problem repeats again. macOS 14.3.1 (23D60) Xcode 15.2 (15C500b)
Posted Last updated
.
Post not yet marked as solved
12 Replies
8k Views
I downloaded Xcode 15 beta 5 and I'm trying to work on my app, but it's having a problem with the simulator. It can't find the runtime I guess. This is the first time I've ran into this. When I try to run, this is what I get: The com.apple.CoreSimulator.SimRuntime.iOS-17-0 simulator runtime is not available. runtime profile not found using "System" match policy Download the com.apple.CoreSimulator.SimRuntime.iOS-17-0 simulator runtime from the Xcode Settings. Not sure what to do here. I also installed the latest iOS 17 developer beta on my device and Xcode doesn't work with that either. I can't help but think the development team forgot something here.
Posted Last updated
.
Post not yet marked as solved
3 Replies
182 Views
Hi, do you guys have any idea why this code block doesn't run properly on a designed iPad app running on a vision pro simulator? I'm trying to add a hovering effect to a view in UIKit but it just doesn't enter this if statement. if #available(iOS 17.0, visionOS 1.0, *) { someView.hoverStyle = .init(effect: .automatic) }
Posted Last updated
.
Post not yet marked as solved
1 Replies
320 Views
Simulators will not install. Run destinations all empty. Can't even run on device. XCode 15.4 beta Sonoma 14.4.1 Intel Mac 16" MBP Attached screenshot of error. iOS 17.5 beta 2 (21F5058d) "Not compatible with XCode 15.4 beta" No run destinations appear. Not even 17.4 device that is plugged in. This all worked yesterday after initial XCode upgrade to 15.4 beta. Now all destinations are missing, even though they appear as installed in the 'Platforms' window. (yes I have rebooted and restarted XCode).
Posted
by a11y.
Last updated
.
Post not yet marked as solved
0 Replies
112 Views
Hello, everyone, I have a problem I'm stuck with and have been trying to solve without success for the past 2 weeks. I am developing a SwiftUI application for Apple Watch which for now I am only running on the simulator. This application has to play sounds but unfortunately so far without success for Apple Watch simulator. When I tap the button on the application running on the Series 9 (45mm) simulator with watchOS 10.2. I cannot hear any sounds on my MacBook Pro. This happens for all Apple Watch simulators I have in my MacBook. The same exact code works on the iPhone 15 simulator with iOS 17.2 and I hear the file 1.mp3 from MacBook Pro speakers and also from bluetooth hearphones, if I connect them. The code is this import SwiftUI import AVFoundation struct ContentView: View { @State var audioPlayer:AVPlayer? @State var isPlaying : Bool = false var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Button("Play"){ if let path = Bundle.main.path(forResource: "1", ofType: "mp3") { let fileUrl = URL(fileURLWithPath: path) do{ try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback) try AVAudioSession.sharedInstance().setActive(true) audioPlayer = AVPlayer(url: fileUrl) guard let audioPlayer = audioPlayer else { return } audioPlayer.play() } catch { } } } } .padding() } } Thanks for your support!
Posted Last updated
.
Post not yet marked as solved
2 Replies
259 Views
Hello everyone, I'm programming my app and after a few days I opened and ran it on my iPhone. This app worked, but with one big problem. The problem is that the app doesn't show up in my settings and I don't know why. I didn't program/change anything. Thanks for the advice
Posted
by MORADENS.
Last updated
.