Appium的使用

Appium的使用

about-appium

Appium-desktop 1.22分成了appium-desktopappium-inspector

appium-desktop

desktop直接点击start即可

请添加图片描述

appium-inspector

请添加图片描述

注意的是Remote Path需要填写/wd/hub.

然后直接点击StartSession即可.(缺少什么会有报错提醒).

{
  "platformName": "iOS",
  "appium:bundleId": "待测试的bundleId",
  "appium:automationName": "XCUITest",
  "appium:deviceName": "iPhone 13 Pro Max",
  "appium:udid": "设备udid"
}

如果未填写udid,点击start会开启一个Simulator.填写了真机的udid则会开启真机上对应bundleId的项目/或者报错.

Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 "
The folder “WebDriverAgentRunner_iphoneos15.2-arm64.xctestrun” doesn’t exist."
UserInfo={NSFilePath=/Users/xxx/Library/Developer/Xcode/DerivedData/WebDriverAgent-aghlrsejdreqngftgvcqwnjgrbou/Build/Products/WebDriverAgentRunner_iphoneos15.2-arm64.xctestrun, NSUserStringVariant=Folder, NSUnderlyingError=0x600002fa9020 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} ** TEST BUILD FAILED **

这是因为WebDriverAgent太老了

git clone https://github.com/facebook/WebDriverAgent

mkdir -p Resources/WebDriverAgent.bundle

下载下来之后将Scripts路径下的bootstrap.sh文件中大概70行的`npm install`命令改为`npm i --legacy-peer-deps`.

sh ./Scripts/bootstrap.sh
  1. 修改BundleID

  2. 修改TARGETS->Build Setting->All || Combined->Validate Workspace->YES.

  3. WebDriverAgent(Target)->Frameworks->iOS->RoutingHTTPServer

@property (nonatomic, assign, readonly) HTTPConnection *connection;
改为
@property (nonatomic, unsafe_unretained, readonly) HTTPConnection *connection;

PrivateHeaders/XCTest/XCTestCase.h 中添加

@property(nonatomic) BOOL shouldSetShouldHaltWhenReceivesControl; // @synthesize shouldSetShouldHaltWhenReceivesControl=_shouldSetShouldHaltWhenReceivesControl;

WebDriverAgentLib/Utilities/FBFailureProofTestCase.m 中
issues:13949

- (void)setUp
{
  [super setUp];
  self.continueAfterFailure = YES;
  self.internalImplementation = (_XCTestCaseImplementation *)[FBXCTestCaseImplementationFailureHoldingProxy proxyWithXCTestCaseImplementation:self.internalImplementation];
}
改为
- (void)setUp
{
  [super setUp];
  self.continueAfterFailure = YES;
  if ([self respondsToSelector:@selector(internalImplementation)]) {
    self.internalImplementation = (_XCTestCaseImplementation *)[FBXCTestCaseImplementationFailureHoldingProxy proxyWithXCTestCaseImplementation:self.internalImplementation];
  } else {
    self.shouldSetShouldHaltWhenReceivesControl = NO;
    self.shouldHaltWhenReceivesControl = NO;
  }
}

command + U

国内8100端口被封禁,可以转发端口iproxy 8300 8100

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值