37 lines
1.4 KiB
Plaintext
37 lines
1.4 KiB
Plaintext
#include "bindings/bindings.h"
|
|
#import <UIKit/UIKit.h>
|
|
#include <cstdlib>
|
|
#include <unistd.h>
|
|
|
|
extern "C" void install_ios_workspace(void);
|
|
|
|
int main(int argc, char * argv[]) {
|
|
@autoreleasepool {
|
|
// Xcode mirrors os_log to stderr. Tauri 2.11 redirects stderr back to os_log,
|
|
// which can fill its pipe and block UIKit/XCTest. Keep Xcode's original streams.
|
|
const bool debuggerLogging = getenv("OS_ACTIVITY_DT_MODE") != nullptr
|
|
|| getenv("XCTestConfigurationFilePath") != nullptr;
|
|
__block int originalOut = debuggerLogging ? dup(STDOUT_FILENO) : -1;
|
|
__block int originalError = debuggerLogging ? dup(STDERR_FILENO) : -1;
|
|
[[NSNotificationCenter defaultCenter]
|
|
addObserverForName:UIApplicationDidBecomeActiveNotification
|
|
object:nil
|
|
queue:NSOperationQueue.mainQueue
|
|
usingBlock:^(NSNotification *notification) {
|
|
if (originalOut >= 0) {
|
|
dup2(originalOut, STDOUT_FILENO);
|
|
close(originalOut);
|
|
originalOut = -1;
|
|
}
|
|
if (originalError >= 0) {
|
|
dup2(originalError, STDERR_FILENO);
|
|
close(originalError);
|
|
originalError = -1;
|
|
}
|
|
install_ios_workspace();
|
|
}];
|
|
ffi::start_app();
|
|
return 0;
|
|
}
|
|
}
|