如何通过命令行从src,.app或.ipa安装iOS应用程序到硬件设备

时间:2021-09-11 21:08:36

For test automation (GUI test, not XCUnitTest) purposes, I need to install an iOS app onto a physical hardware device.

对于测试自动化(GUI测试,而不是XCUnitTest),我需要在物理硬件设备上安装iOS应用程序。

I'm looking for:

我在找:

  • a replacement to Fruitstrap (it has been abandoned)
  • Fruitstrap的替代品(已被放弃)

  • or a way to perform XCode's "Build & Run" action on a target device
  • 或者在目标设备上执行XCode“构建和运行”操作的方法

I've tried:

  1. using xcodebuild and pointing the -destination argument at the target device and providing build actions of clean and install

    使用xcodebuild并将-destination参数指向目标设备并提供清理和安装的构建操作

  2. It finds the target device and begins cleaning and then installing.

    它找到目标设备并开始清洁然后安装。

  3. At the end of all the files being compiled and the app being signed, I get a success message

    在编译的所有文件和正在签名的应用程序结束时,我收到了成功消息

** INSTALL SUCCEEDED **

But, alas, no app is installed on my phone.

但是,唉,我的手机上没有安装应用程序。

This is my full xcodebuild command:

这是我的完整xcodebuild命令:

xcodebuild 
    -destination platform=iOS,id=######## \
    clean install

Here's the gist of the output

这是输出的要点

Creative suggestions welcome.

欢迎创意建议。

I'm considering writing an applescript if needed, but wish there was a better way.

我正在考虑在需要时编写一个AppleScript,但希望有更好的方法。

1 个解决方案

#1


0  

Fruitstrap is, for the time being, working and installing the app correctly.

Fruitstrap目前正在正确地工作和安装应用程序。

/path/to/fruitstrap \
install -id ##udid### \
--bundle "/Users/#######/path/to/application.ipa"

Other, more maintained solutions are still welcome.

其他更维护的解决方案仍然受欢迎。

Limitations:

  • Need to have a prebuilt .ipa file
  • 需要预先构建的.ipa文件

  • Target device must be signed with a provisioning profile that includes the target device's udid
  • 目标设备必须使用包含目标设备的udid的配置文件进行签名

#1


0  

Fruitstrap is, for the time being, working and installing the app correctly.

Fruitstrap目前正在正确地工作和安装应用程序。

/path/to/fruitstrap \
install -id ##udid### \
--bundle "/Users/#######/path/to/application.ipa"

Other, more maintained solutions are still welcome.

其他更维护的解决方案仍然受欢迎。

Limitations:

  • Need to have a prebuilt .ipa file
  • 需要预先构建的.ipa文件

  • Target device must be signed with a provisioning profile that includes the target device's udid
  • 目标设备必须使用包含目标设备的udid的配置文件进行签名