安装代理ipa
- 这篇文章已经过期, 对于有mac电脑的同学可以尝试编译源码
- 如果没有mac电脑的同学, 直接去购买签名, 或者论坛搜索 巨 魔, 使用巨魔签名
- 也可以自己申请苹果付费的开发者账户, 自己签名ipa
下载Agent源码
编译Agent源码请使用 mac系统
, 为了节省成本, 可以使用mac mini二手(淘宝一大堆)或者虚拟机安装黑苹果, 百度一下一堆教程
编译Agent源码需要使用xcode
, 建议使用xcode 13.1版本
因为往往涉及到配置Team
和自动签名
等事宜
请到资源区网盘最终找到这个压缩包, 下载到本地并解压

双击
easyclick.xcodeproj
xcode会自动打开这个工程

设置签名
签名类型:
普通的appleid签 名:
- 免费
- 限制: 只能安装3台设备, bundleId只能允许十天更改三次,
证书7天就会过期, 需要再次使用xcode运行代理ipa源码
- 地址: https://appleid.apple.com/account
个人开发者签名:
- 费用688元, 使用iPhone
- 限制: 安装100台设备, 证书一年后过期, 过期后需要再次使用xcode运行代理ipa源码
- 地址:https://developer.apple.com/cn/support/enrollment/
- https://www.jianshu.com/p/029167817dde
这里演示的是appleid免费的签名
实际开发和调试脚本可以使用免费appleid
正式使用超过3台设备, 需要使用个人开发者签名或者申请大量的免费appleid签名
点击左上角的项目, 进入项目属性, 点击TARGETS
中的WebDriverAgentRunner
, 切换到Signing & Capabilities
:

默认Team
是None
, 需要去选择一个自己的苹果账号:
或者点击add account新增一个苹果账号:

然后会触发自动修复, 显示Waiting to repair
:

看到没有其他警告或错误, 就表示自动创建签名和Profile等工作正常了:

编译运行
将iphone插入到电脑, xcode识别后, 选择要运行的iphone:

之后即可正常的Product
->Test
去测试, 启动服务, 供后续使用了

控制台出现了ServerURLHere 代表正常启动了
如果出现这个弹窗, 请到手机信任这个程序:

进入手机的 设置 - 通用 - 设备管理 , 选择开发者应用, 点击信任 apple developement:xxxx

常见错误
Failed to register bundle identifier
如果Signing & Capablities
的自动修复后报错:
No profiles for 'com.ieasyclick.auto.ios' were found
Xcode couldn't find any iOS App Development provisioning profiles matching 'com.ieasyclick.auto.ios'.

原因:(很可能是)默认的ID:com.ieasyclick.auto.ios
已存在, 重复了, 导致无法继续
解决办法:修改为其他(独一无二的)值
操作步骤:
WebDriverAgentRunner`的属性 -> `Build Settings` -> `Packaging` -> `Product Bundle Identifier
把值从默认的:com.ieasyclick.auto.ios 改为别的, 确保不重复的值, 比如我此处改为:com.ieasyclick.auto.ios.xxxx1

别处调用到此处的Product Bundle Identifier
后来注意到一个细节, 别处会调用到此处的Product Bundle Identifier
中的值
比如:Info
->Key
->Bundle Identifier
: $(PRODUCT_BUNDLE_IDENTIFIER)

XCode报错:A build only device cannot be used to run this target
A build only device cannot be used to run this target.
No supported iOS devices are available. Connect a device to run your application or choose a simulated device as the destination.
原因:XCode中没有选择正确的目标设备
解决办法:插入iPhone, 且选择对应的iPhone等iOS真机设备
xcodebuild报错:Signing certificate is invalid
原因:自己的Apple苹果(开发者)账号过期了不可用, 没法给代码code sign了
解决办法:花钱, 给苹果开发者账号续费价格:99美元/年
XCode报错:The certificate used to sign has either expired or has been revoked
Unable to install "WebDriverAgentRunner-Runner"
The certificate used to sign "WebDriverAgentRunner-Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.
点击Details
还可以看到详情:
Details
Unable to install "WebDriverAgentRunner-Runner"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620392
Recovery Suggestion: The certificate used to sign "WebDriverAgentRunner-Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.
--
The identity used to sign the executable is no longer valid.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620392
User Info: {
DVTRadarComponentKey = 487925;
MobileDeviceErrorCode = "(0xE8008018)";
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x000000011d4bcc8f DTDKCreateNSErrorFromAMDErrorCode + 220
1 DTDeviceKitBase 0x000000011d4fb241 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
2 DVTFoundation 0x0000000101ba464b DVTInvokeWithStrongOwnership + 71
3 DTDeviceKitBase 0x000000011d4faf82 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1440
4 IDEiOSSupportCore 0x000000011d36ba10 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.292 + 3513
5 DVTFoundation 0x0000000101cd317e __DVT_CALLING_CLIENT_BLOCK__ + 7
6 DVTFoundation 0x0000000101cd4da0 __DVTDispatchAsync_block_invoke + 1191
7 libdispatch.dylib 0x00007fff6db306c4 _dispatch_call_block_and_release + 12
8 libdispatch.dylib 0x00007fff6db31658 _dispatch_client_callout + 8
9 libdispatch.dylib 0x00007fff6db36c44 _dispatch_lane_serial_drain + 597
10 libdispatch.dylib 0x00007fff6db375d6 _dispatch_lane_invoke + 363
11 libdispatch.dylib 0x00007fff6db40c09 _dispatch_workloop_worker_thread + 596
12 libsystem_pthread.dylib 0x00007fff6dd8ba3d _pthread_wqthread + 290
13 libsystem_pthread.dylib 0x00007fff6dd8ab77 start_wqthread + 15
);
}
--
System Information
macOS Version 10.15.7 (Build 19H2)
Xcode 12.4 (17801) (Build 12D4e)
Timestamp: 2021-04-13T21:17:10+08:00
原因:苹果开发者账号过期了, 没续费导致证书不可用
解决办法:同上, 续费 即可