├── .gitignore ├── Makefile ├── README.assets ├── 20241008172148.png ├── image-20241008172928806.png ├── image-20241008173034932.png └── image-20241008173144917.png ├── README.md ├── Resources ├── 20241008172148.jpg └── debugserver_xcode ├── Tweak.x ├── XcodeAnyDebugRootless.plist ├── control └── layout ├── DEBIAN ├── postinst ├── preinst └── prerm └── usr └── bin └── debugserver_xcode.entitlements /.gitignore: -------------------------------------------------------------------------------- 1 | .theos/ 2 | packages/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | THEOS_PACKAGE_SCHEME = rootless 3 | 4 | 5 | include $(THEOS)/makefiles/common.mk 6 | 7 | TWEAK_NAME = XcodeAnyDebugRootless 8 | 9 | XcodeAnyDebugRootless_FILES = Tweak.x 10 | XcodeAnyDebugRootless_CFLAGS = -fobjc-arc 11 | 12 | include $(THEOS_MAKE_PATH)/tweak.mk 13 | -------------------------------------------------------------------------------- /README.assets/20241008172148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/README.assets/20241008172148.png -------------------------------------------------------------------------------- /README.assets/image-20241008172928806.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/README.assets/image-20241008172928806.png -------------------------------------------------------------------------------- /README.assets/image-20241008173034932.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/README.assets/image-20241008173034932.png -------------------------------------------------------------------------------- /README.assets/image-20241008173144917.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/README.assets/image-20241008173144917.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XcodeAnyDebugRootless 2 | 3 | ![20241008172148](README.assets/20241008172148.png) 4 | 5 | ## 简介 6 | 7 | XcodeAnyDebugRootless 让你能够使用 Xcode 调试任意 iOS 应用。基于 Dopamine 越狱环境开发,提供安全稳定的调试体验。 8 | 9 | ## 主要特性 10 | 11 | - 支持调试任意已安装的 iOS 应用(包括 App Store 上下载的) 12 | - 完全兼容 Dopamine 越狱环境 13 | - 采用无根设计,安全可靠 14 | - 无需配置直接使用 15 | - 不影响正常的 Xcode 安装调试 App 16 | 17 | ## 安装 18 | 19 | - 已越狱的 iOS 设备 (使用 Dopamine) 20 | - 安装了 Xcode 的 Mac 电脑 21 | - 下载 Releases 的附件 deb文件 使用 `Sileo` 或者 `dpkg` 进行安装 22 | 23 | ## 使用 24 | 25 | - 创建 Xcode 项目,选中越狱设备 26 | 27 | ![image-20241008172928806](README.assets/image-20241008172928806.png) 28 | 29 | - 选择 `Debug` - `Attach to Process by PID or Name` 30 | 31 | ![image-20241008173034932](README.assets/image-20241008173034932.png) 32 | 33 | - 输入要调试的可执行文件名称 34 | 35 | ![image-20241008173144917](README.assets/image-20241008173144917.png) 36 | 37 | - 启动 App 即可调试 38 | 39 | ## 注意事项 40 | 41 | 本工具仅供开发学习使用,请遵守相关法律法规。 42 | -------------------------------------------------------------------------------- /Resources/20241008172148.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/Resources/20241008172148.jpg -------------------------------------------------------------------------------- /Resources/debugserver_xcode: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DargonLee/XcodeAnyDebugRootless/188e71bfd2e2ae0d4524af3664093fac914008c3/Resources/debugserver_xcode -------------------------------------------------------------------------------- /Tweak.x: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #import 4 | 5 | static void* _SMJobSubmit; 6 | static int last_inst_time = 0; 7 | static void nouse(){} 8 | static void* _CFPropertyListCreateData = (void*)nouse; 9 | 10 | %hookf(CFDataRef, _CFPropertyListCreateData, CFAllocatorRef allocator, CFPropertyListRef propertyList, CFPropertyListFormat format, CFOptionFlags options, CFErrorRef* error) { 11 | if (CFGetTypeID(propertyList) == CFDictionaryGetTypeID()) { 12 | NSDictionary* info = (__bridge NSDictionary*)propertyList; 13 | if (info[@"Service"] != nil && [info[@"Service"] isEqualToString:@"com.apple.mobile.installation_proxy"]) { 14 | last_inst_time = time(0); 15 | } 16 | NSLog(@"_SMJobSubmit => _CFPropertyListCreateData info: %@", info); 17 | } 18 | return %orig; 19 | } 20 | 21 | %hookf(Boolean, _SMJobSubmit, CFStringRef domain, CFDictionaryRef job, CFTypeID auth, CFErrorRef *outError) 22 | { 23 | NSMutableDictionary* mjob = [(__bridge NSDictionary*)job mutableCopy]; 24 | if (job != nil && mjob[@"ProgramArguments"] != nil) 25 | { 26 | NSArray* argv = mjob[@"ProgramArguments"]; 27 | NSLog(@"_SMJobSubmit argv=%@", argv); 28 | 29 | NSString *path = argv.firstObject; 30 | NSLog(@"_SMJobSubmit path=%@", path); 31 | 32 | if (time(0) - last_inst_time > 3) // 防止影响Xcode安装调试普通App 33 | { 34 | if ([path hasSuffix:@"/debugserver"]) 35 | { 36 | NSMutableArray* new_argv = [argv mutableCopy]; 37 | new_argv[0] = @"/var/jb/usr/bin/debugserver_xcode"; 38 | mjob[@"UserName"] = @"root"; 39 | mjob[@"ProgramArguments"] = new_argv; 40 | job = (__bridge_retained CFDictionaryRef)mjob; 41 | } 42 | } 43 | } 44 | 45 | return %orig; 46 | } 47 | 48 | %ctor { 49 | _SMJobSubmit = dlsym(RTLD_DEFAULT, "SMJobSubmit"); 50 | } 51 | -------------------------------------------------------------------------------- /XcodeAnyDebugRootless.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Filter 6 | 7 | Executables 8 | 9 | lockdownd 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.yourcompany.xcodeanydebugrootless 2 | Name: XcodeAnyDebugRootless 3 | Version: 0.1.0 4 | Architecture: iphoneos-arm 5 | Description: debug any process with xcode (jailbroken required) 6 | Maintainer: Harlans 7 | Author: Harlans 8 | Section: Tweaks 9 | Depends: ldid, mobilesubstrate (>= 0.9.5000) 10 | -------------------------------------------------------------------------------- /layout/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | ldid -M -S/var/jb/usr/bin/debugserver_xcode.entitlements /var/jb/usr/bin/debugserver_xcode 5 | killall -9 lockdownd || true 6 | 7 | # killall -9 lockdownd >/dev/null 2>&1 8 | # exit 0 9 | -------------------------------------------------------------------------------- /layout/DEBIAN/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [ -f /var/jb/usr/bin/debugserver_xcode ]; then 6 | rm -rf /var/jb/usr/bin/debugserver_xcode 7 | fi 8 | 9 | 10 | if [ -f /Developer/usr/bin/debugserver ]; then 11 | cp /Developer/usr/bin/debugserver /var/jb/usr/bin/debugserver_xcode 12 | echo "* Developer Disk Image mounted" 13 | else 14 | echo "* Developer Disk Image not mounted, run xcode to connect and pair your device first." >&2 15 | exit 1 16 | fi 17 | -------------------------------------------------------------------------------- /layout/DEBIAN/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -rf /var/jb/usr/bin/debugserver_xcode 4 | 5 | killall -9 lockdownd || true 6 | -------------------------------------------------------------------------------- /layout/usr/bin/debugserver_xcode.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.appletv.pbs.allow-launch-kiosk 6 | 7 | com.apple.assertiond.app-state-monitor 8 | 9 | com.apple.backboardd.debugapplications 10 | 11 | com.apple.backboardd.launchapplications 12 | 13 | com.apple.diagnosticd.diagnostic 14 | 15 | com.apple.frontboard.debugapplications 16 | 17 | com.apple.frontboard.launchapplications 18 | 19 | com.apple.private.cs.debugger 20 | 21 | com.apple.private.logging.diagnostic 22 | 23 | com.apple.private.memorystatus 24 | 25 | com.apple.security.cs.debugger 26 | 27 | com.apple.security.network.client 28 | 29 | com.apple.security.network.server 30 | 31 | com.apple.springboard.debugapplications 32 | 33 | com.apple.system-task-ports 34 | 35 | platform-application 36 | 37 | run-unsigned-code 38 | 39 | task_for_pid-allow 40 | 41 | 42 | 43 | --------------------------------------------------------------------------------