免安裝免配置環(huán)境的免費(fèi) ios 調(diào)試工具 sib 來(lái)啦

sib是以gidevice為底層實(shí)現(xiàn)的iOS調(diào)試工具,因?yàn)間o語(yǔ)言特性,編譯好的二進(jìn)制文件可以直接運(yùn)行,所以不需要額外配置python環(huán)境或者go環(huán)境,直接下載3M左右的包解壓就可以使用啦!sonic組織也在持續(xù)參與建設(shè)gidevice。當(dāng)前迭代了數(shù)月,到達(dá)了1.1.2版本,基礎(chǔ)功能如下:

```

設(shè)備基礎(chǔ)信息獲取、設(shè)備監(jiān)聽(tīng)

App安裝卸載、啟動(dòng)終止

查看進(jìn)程信息

啟動(dòng)xctest相關(guān),如:?jiǎn)?dòng)Wda、Fastbot_iOS

獲取電池相關(guān)信息

重啟關(guān)機(jī)

代理轉(zhuǎn)發(fā)

崩潰信息收集

模擬定位與取消(部分App不生效)

屏幕旋轉(zhuǎn)監(jiān)聽(tīng)

系統(tǒng)日志獲取

性能采集(Doing)

截圖

文件管理

```

以上功能皆跨平臺(tái),即Windows、Mac、Linux都可以使用。

***UI自動(dòng)化的應(yīng)用(Appium)***

以Java為例:

先用sib啟動(dòng)wda(需要指定端口可以參考官網(wǎng)文檔的參數(shù))

```

sib run wda

```

然后在腳本里配置Driver

```

? ? ? DesiredCapabilities desiredCapabilities = new DesiredCapabilities();

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, Platform.IOS);

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 3600);

? ? ? ? desiredCapabilities.setCapability(IOSMobileCapabilityType.COMMAND_TIMEOUTS, 3600);

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.NO_RESET, true);

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, 【設(shè)備名稱,也可以通過(guò)sib獲取】);

? ? ? ? desiredCapabilities.setCapability(MobileCapabilityType.UDID, udId);

? ? ? ? desiredCapabilities.setCapability("wdaConnectionTimeout", 60000);

? ? ? ? desiredCapabilities.setCapability(IOSMobileCapabilityType.WEB_DRIVER_AGENT_URL, "http://127.0.0.1:8100");

? ? ? ? desiredCapabilities.setCapability("useXctestrunFile", false);

? ? ? ? desiredCapabilities.setCapability(IOSMobileCapabilityType.SHOW_IOS_LOG, false);

? ? ? ? desiredCapabilities.setCapability(IOSMobileCapabilityType.SHOW_XCODE_LOG, false);

? ? ? ? desiredCapabilities.setCapability("skipLogCapture", true);

? ? ? ? desiredCapabilities.setCapability(IOSMobileCapabilityType.USE_PREBUILT_WDA, false);

? ? ? ? new IOSDriver("http://localhost:4723/wd/hub", desiredCapabilities);

```

即可啟動(dòng)。

***在 Fastbot 應(yīng)用***

```

sib run xctest? -b bytedance.FastbotRunner.xxxxxxx.xctrunner -e

BUNDLEID=com.xxxxxx.internalapp -e duration=1 -e throttle=500

```

注意,因?yàn)閣da和fastbot部分底層是相同,所以同時(shí)啟動(dòng)wda和fastbot會(huì)阻塞哦

***獲取 App 圖標(biāo)***

加上-i參數(shù)即可獲取icon,格式為base64

```

sib app list -i

```

前端渲染后效果如圖


App的管理還有很多,例如安裝、卸載、啟動(dòng)、強(qiáng)殺

```

sib app install

sib app uninstall

sib app launch

sib app kill

```

<strong>屏幕旋轉(zhuǎn)監(jiān)聽(tīng)</strong>

```

sib orientation

```

您會(huì)獲得類似的輸出

```

orientation: 1

```


<strong>獲取設(shè)備信息</strong>

```

sib devices -d -f

```

你會(huì)獲得類似輸出

```

{

? ? ? ? "deviceList": [

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? "deviceId": 1,

? ? ? ? ? ? ? ? ? ? ? ? "connectionSpeed": 0,

? ? ? ? ? ? ? ? ? ? ? ? "connectionType": "USB",

? ? ? ? ? ? ? ? ? ? ? ? "locationId": 0,

? ? ? ? ? ? ? ? ? ? ? ? "productId": 4776,

? ? ? ? ? ? ? ? ? ? ? ? "serialNumber": "0000****-001****6F****E",

? ? ? ? ? ? ? ? ? ? ? ? "status": "online",

? ? ? ? ? ? ? ? ? ? ? ? "deviceDetail": {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "generationName": "iPhone 13 Pro",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "deviceName": "iPhone",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "deviceColor": "1",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "deviceClass": "iPhone",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "productVersion": "15.4.1",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "productType": "iPhone14,2",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "productName": "iPhone OS",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "passwordProtected": true,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "modelNumber": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "serialNumber": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "simStatus": "kCTSIMSupportSIMStatusReady",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "phoneNumber": "+86 *****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "cpuArchitecture": "arm64e",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "protocolVersion": "2",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "regionInfo": "CH/A",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "telephonyCapability": true,

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "timeZone": "Asia/Shanghai",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "uniqueDeviceID": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "wifiAddress": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "wirelessBoardSerialNumber": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "bluetoothAddress": "*****",

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "buildVersion": "*****"

? ? ? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? }

? ? ? ? ]

}

```

相關(guān)功能還有很多很多,這里就不全部放出來(lái)啦,推薦前往官方文檔查看更多詳細(xì)信息哦!

```

sib run wda -b your.wda.bundleId

sib run xctest -b your.wda.bundleId

sib app list

sib app launch

sib devices listen

sib app uninstall

sib screenshoot

sib ps

sib crash

sib location

sib oritation

sib battery

sib info

...

```

***結(jié)語(yǔ)***

sib還在持續(xù)更新中,正在挖掘無(wú)人觸碰的領(lǐng)域,也歡迎有能力的小伙伴參與建設(shè) ~

官網(wǎng)文檔(下載、安裝、文檔):

**https://sonic-cloud.gitee.io/#/SIB**

用戶社區(qū)(提bug、需求):

**https://sonic-cloud.wiki/**

Github:

https://github.com/SonicCloudOrg/sonic-ios-bridge


推薦學(xué)習(xí)

https://qrcode.ceba.ceshiren.com/link?name=article&project_id=qrcode&from=jianshu&timestamp=1663120800&author=DongL

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容