I have a 2019 16 inch MacBook Pro running Catalina 10.15.5 with a strange problem. Just launching the Simulator can hard freeze the entire machine. The Simulator launches, the device shows a spinner that just keeps going and within a couple of seconds the machine beach-balls and the entire UI freezes with no possibility of option-command-escape to kill the Simulator.
I've looked in the logs afterward and I don't see any good clues. This problem is much more likely to occur with a simulated iPhone device (much more rare with a simulated iPad) and it doesn't happen every time I launch a simulated iPhone, just somewhere between 1/3 and 1/2 of the time.
Does anyone have any debugging or diagnostic ideas?
Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi all - I am curious as to whether it is a good idea to make a separate Apple ID for distributing apps, etc. I am working on apps as a side gig and I'm trying to decide how to approach this. Are there any "gotchas" if you set up a second Apple ID just for your paid developer account? I assume you can set up your personal ID as a "developer" in App Store Connect for testing. How do you do two-factor for the "business" ID? (Do you need a separate device for that?) Do you use the same phone number for both accounts (I'm only planning on having one phone, haha)? Are there actually any meaningful advantages to having a separate Apple ID for this purpose?
Thanks for any thoughts on this!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store Connect
Developer ID
Hello - I posted this question on StackOverflow and it didn't get any traction, so I thought I'd repost it here.
https://stackoverflow.com/questions/65370523/how-to-run-ui-tests-for-swiftui-app-lifecycle-apps-with-different-environments
I'm trying to figure out how to run UI tests for a SwiftUI app that is using the "SwiftUI App lifecycle" with preview data - in particular some data for CoreData, but it might be more general.
With the SwiftUI App lifecycle, we know have "main" entry points like:
@main
struct MyApp: App {
	let persistenceController = PersistenceController.shared
	
	var body: some Scene {
		WindowGroup {
			ContentView()
				.environment(\.managedObjectContext, persistenceController.container.viewContext)
		}
	}
}
wherePersistenceController is a struct that is managing the CoreData stuff (with this example created by Apple's template if you just make a new App and select "use CoreData"). I have written an extension with a bunch of preview data that can easily be loaded in PreviewProviders just by setting a different managedObjectContext with .environment() on the view code, etc. for use while developing the UI code.
Is there a way to make this preview data available inside a UI test? We usually have UI test code that looks sort of like:
class MyUITests: XCTestCase {
	
	var app: XCUIApplication!
	
	override func setUpWithError() throws {
		app = XCUIApplication()
		app.launch()
		continueAfterFailure = false
	}
	
	func testTabBarButtonsAndNavTitles() throws {
		let tabBar = app.tabBars["Tab Bar"]
		let loadAndGoTabBarButton = tabBar.buttons["Load and go"]
		loadAndGoTabBarButton.tap()
		XCTAssert(app.navigationBars["Load a thing and do it"].exists)
	}
Is there a way I can tell the XCUIApplication() to use a different managedObjectContext value in the environment call when it starts?
If not - it seems like the only way to test some of the SwiftUI elements would be to have the UI test function first "tap around" and enter a bunch of preview data, but this is really cumbersome. It would be better if the app could start up for testing with some saved data.
Apologies for not providing a fully runnable piece of code to illustrate this, but it would require a lot of infrastructure and boilerplate, etc. Thanks for any thoughts on this!