@@ -4,6 +4,7 @@ import { Sema } from "async-sema";
4
4
import { clamp , isEmpty , isNotEmpty } from "@server/helpers/utils" ;
5
5
import { TransactionPromise , TransactionResult } from "@server/managers/transactionManager/transactionPromise" ;
6
6
import { TransactionManager } from "@server/managers/transactionManager" ;
7
+ import { execSync } from "child_process" ;
7
8
8
9
import { MAX_PORT , MIN_PORT } from "./Constants" ;
9
10
import { PrivateApiEventHandler } from "./eventHandlers" ;
@@ -105,6 +106,9 @@ export class PrivateApiService extends Loggable {
105
106
this . log . debug ( "Starting Private API Helper Services..." ) ;
106
107
await this . configureServer ( ) ;
107
108
109
+ // Execute the boot argument command if conditions are met
110
+ this . setBootArgs ( ) ;
111
+
108
112
// we need to get the port to open the server on (to allow multiple users to use the bundle)
109
113
// we'll base this off the users uid (a unique id for each user, starting from 501)
110
114
// we'll subtract 501 to get an id starting at 0, incremented for each user
@@ -408,4 +412,19 @@ export class PrivateApiService extends Loggable {
408
412
await this . mode ?. stop ( ) ;
409
413
this . log . info ( `Private API Helper Stopped...` ) ;
410
414
}
415
+
416
+ private setBootArgs ( ) {
417
+ const osVersion = os . release ( ) ;
418
+ const isM1Mac = os . cpus ( ) . some ( cpu => cpu . model . includes ( "Apple M1" ) ) ;
419
+ const isVentura = osVersion . startsWith ( "22." ) ;
420
+
421
+ if ( isM1Mac && isVentura ) {
422
+ try {
423
+ execSync ( "sudo nvram boot-args=-arm64e_preview_abi" ) ;
424
+ this . log . info ( "Successfully set boot-args for macOS Ventura on M1 Mac." ) ;
425
+ } catch ( error ) {
426
+ this . log . error ( "Failed to set boot-args for macOS Ventura on M1 Mac:" , error ) ;
427
+ }
428
+ }
429
+ }
411
430
}
0 commit comments