The motivation of this PR is to pass native logs to Radon IDE. Currently, if the app crashes on the native side developer needs to open Xcode anyway.
⚠️ DISCLAIMER: The current approach won't work with Expo Go and Expo Dev Client, as those are run through deep link not xcrun simctl launch.
I tried: xcrun simctl --set {deviceLocation} spawn booted log stream, react-native log-ios, looking through files in the container if there is something that looks like logs - none of those work.
What I did:
add params to xcrun simctl launch that print stderr and stout to file,
watch for changes in this log file,
send new chunks into VSCode output.
Changed during review:
What I did:
add --console param to xcrun simctl launch, which logs the process output
redirect this output to VSCode.
How Has This Been Tested:
Normal:
Start by adding to AppDelegate.mm, didFinishLaunchingWithOptions:
Restart app process, verify that new logs are comming
Crash:
Start by adding to AppDelegate.mm, didFinishLaunchingWithOptions:
NSLog(@"AppDelegate didFinishLaunchingWithOptions");
double delayInSeconds = 5.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); // 1
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ // 2
@throw [NSException exceptionWithName:@"Something is not right exception"
reason:@"Can't perform this operation because of this or that"
userInfo:nil];
});
1. Start the app, it should crash after 5s
2. Go to `Radon IDE (iOS Simulator Logs)` output
3. Look for the error in the output
### Demo
<video src="https://github.com/user-attachments/assets/ed065f66-b710-4227-8ec6-7ebb72b3964f" />
The motivation of this PR is to pass native logs to Radon IDE. Currently, if the app crashes on the native side developer needs to open Xcode anyway.
⚠️ DISCLAIMER: The current approach won't work with Expo Go and Expo Dev Client, as those are run through deep link not
xcrun simctl launch
.I tried:
xcrun simctl --set {deviceLocation} spawn booted log stream
,react-native log-ios
, looking through files in the container if there is something that looks like logs - none of those work.What I did:xcrun simctl launch
that printstderr
andstout
to file,Changed during review:
What I did:
--console
param toxcrun simctl launch
, which logs the process outputHow Has This Been Tested:
Normal:
didFinishLaunchingWithOptions
:Radon IDE (iOS Simulator Logs)
outputCrash:
Start by adding to AppDelegate.mm,
didFinishLaunchingWithOptions
: