M1 Xcode Launched App is frozen with DebugServer hogging the process - ios

When I compile my app on Xcode and run it on normal Intel MacBook Pro, all good.
However, when run it on M1 MacBook Pro, I got the error on the console
rosetta error: mmap_anonymous_rw_guard_page mprotect failed
And then the App keeps frozen on the Launching Screen in the Simulator.
If I see the Activity Monitor, it has debugserver hogging the machine (as shown in diagram below). I kill it, then the App will die.
But I can relaunch the App from the simulator, and all is good. It's just that I have no way debugging the App on the Simulator. How can I get this issue fixed on M1?

Related

react-native app crashes when distributed

When running the app on a simulator (or on a connected iPhone), I have no trouble running the application.
However when I archive the app in xcode (build succeeds) and distribute it using either HockeyApp or Fabric, the app installs just fine, but upon opening the app, it crashes right after the splash screen.
The log-file that is being generated on the iPhone does not give any useful information
On the Fabric/HockeyApp dashboard no crashes are being registered.
Any advice on how to get a stack trace or other useful crash log?
When running the react-native app using react-native run-ios --configuration Release, I was able to reproduce the error in the simulator and fix the JS error that was somehow not appearing running in debug mode. Logs for the Simulator can be found at
~/Library/Logs/CoreSimulator

Xcode 9.2 Simulator Debugging Broken; Could not attach to process id

Xcode 9.2 debugging on an iOS Simulator has completely broken for me.
I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.
Summary:
When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:
Could not attach to pid: "<a process id>"
Ensure "<app>" is not already running, and "<user>" has permission to debug it.
Steps to Reproduce:
Make any project and try to run on any simulator.
Expected Results:
Debugger successfully attaches to debugger.
Actual Results:
Debugger is never able to attach to the iOS simulator process/app for debugging.
Debugger CAN attach and build and run successfully on a physical device.
Version/Build:
- Xcode Version 9.2 (9C40b)
- macOS Sierra 10.12.6
- Any iOS project
- Any iOS simulator
Other notes:
- Xcode 9.2 was working fine until this problem randomly started. The error initially said:
Failed to initiate service connection to simulator
DTServiceHubClient failed to bless service hub for
simulator iPhone 8 Plus <simulator identifier>
- After rebooting computer, the error shifted to "Could not attached to pid..."
I tried dozens of suggested solutions short of completely wiping my computer including:
Resetting device contents and settings on simulators
Create a new device (even different device and OS combinations)
Try different Xcode projects, even simple one-off single view applications
Looking at the etc/hosts file and verifying localhost can be pinged
Restarting computer multiple times
Deleting out derived data (multiple times)
Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"
Completely uninstalling Xcode and all simulators, and reinstalling.
Removing any invalid certificates in keychain
It turns out our security software was blocking the debugger. Running sudo sysdiagnose helped me find a log entry showing that it was being blocked. The software is Cb Defense (Carbon Black Defense). Apparently the only workaround is for your security team to whitelist by a hash, and that hash could change in the future.
There is a bug in Xcode 9.0-9.2 that causes this issue to appear after running for a while. If you log out and back in it should resolve it for you.

DeviceAgent enter_text failed: Timed out after waiting 1.0s for KeyEventCompleted after sending event for

Xamarin.UITest.XDB.Exceptions.DeviceAgentException:
Error appears in pressing the "Done" button or "Enter" from the soft key board while running on real IPAD device.
On simulator, it works fine.
Technologies used:
MAC Book Pro
IDE: Visual Studio Community 2017
Device: IPAD 2017, IOS 11
Xamarin.UITest V 2.1.3
Xamarin.TestCloud.Agent: 0.21.1
Xcode 9
Try any of the following steps or all of them, it usually works for me:
Restart VS (VS may be using to many resources and become slow…)
Close any REPL terminal, if open.
Restart simulator or reconnect device.
Remove the DeviceAgent-Runner app from your simulator or device
(this is an app installed by UITests and will be reinstalled when
running a UITest)
If it still does not work I usually throw my computer out of the window, that always solves the issue ;-)

iOS simulator reboots between runtimes and start

iOS Rebooting
Whenever I run my application in Xcode. The simulator starts but not directly. It reboots. I tried both iOS 9.0 and 9.1, both of them take a lot of time starting and eventually run the application. I didn't face this issue while using Xcode 6 with iOS 8. Currently, I'm using Xcode 7 with iOS 9.0/9.1. I tried resetting content and settings but it didn't change anything. I have command line tools installed properly.
It will only boot up a different simulator device if you deploy to a device that isn't booted. If your run destination is the same as the booted device, it will not shutdown the booted device and boot a new one. This is not new to Xcode 7. It has always been this way.

App is giving SIGABRT when running on already running simulator

When I am running the application from XCode through the simulator for the first time its running fine. But when the application is running in the simulator and if I run again from the XCode the app is stuck at splash screen, and the app is giving SIGABRT crash. When I stop the build from XCode the app continues to run from the splash screen. What might be the issue?
If you are running Xcode 4.6.2 on OSX 10.8.4, try upgrading to Xcode 4.6.3 which was just released a few days ago. The 4.6.3 version has fixes for the random crashes and hangs that sometimes happens when debugging on the ios simulator.
This is XCode issue. Sometimes the bootstrap fails to register the application. Usually giving an error on console as
Couldn't register com.compname.yourapp with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.Program received signal: “SIGABRT”.
Solution
If running on device, switch off and restart device.
If running on simulator, restart your Mac.

Resources