/InjectionIIISupportDevice

InjectionIII support both device and simulator.

Primary LanguageSwiftMIT LicenseMIT

Injection support both device and simulator

Icon

Thanks johnno1962 Injection: https://github.com/johnno1962/InjectionIII

Support iOS13+ device.

  1. applicationDidFinishLaunching: add below code
#if DEBUG
#if TARGET_OS_SIMULATOR
    NSString *injectionBundlePath = @"/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle";
#else
    NSString *injectionBundlePath = [[NSBundle mainBundle] pathForResource:@"iOSInjection_Device" ofType:@"bundle"];
#endif
    NSBundle *injectionBundle = [NSBundle bundleWithPath:injectionBundlePath];
    if (injectionBundle) {
        [injectionBundle load];
    } else {
        NSLog(@"Not Found Injection Bundle");
    }
#endif
  1. Build Phase -> Run Script run setup shell.
if [[ "$CONFIGURATION" = "Debug" && "$ARCHS" = "arm64" ]]; then
    InjectionSetup="/Applications/InjectionIII.app/Contents/Resources/InjectionSetup"
    if [[ -e "$InjectionSetup" ]]; then
        sh "$InjectionSetup"
    fi
fi
  1. Done.