zoukankan      html  css  js  c++  java
  • 如何在Mac上获取App Store上的ipa用于ios下的appium 自动化测试

    如今很多人想要获取到App Store上的包却苦于无奈,先在要把App Store上的包载下来获取ipa,最直接的就是从手机设备上导出了,但是手机必须要9.0以下才可以导出,鄙人手中正好有公司的测试机,系统是8.1·8.5的几台,所以做起来方便。最近看到好多朋友也在苦恼,毕竟不是谁都有8.x的机子哈哈哈。下面给大家推荐一个工具用来获取ipa!!!(Apple Configurator 2)

    1、首先 去Mac上的App Store下载Apple Configurator 2。然后把iphone连接上Mac,点击Apple Configurator 2 菜单中->账户->登陆(用连接设备的Apple ID)[如果担心设备数据会丢失,就备份下数据]

     

    2、所有设备->1 选中当前iPhone->2 添加-> 3 应用,找到您想要ipa的那个应用->添加

     

    3、添加后会显示如下图片表示正在下载App Store上的应用

    当你的设备上存在这个应用的时候会有如下提示:

     

    这个时候切记,不要点击任何按钮!不要点击任何按钮!不要点击任何按钮!(重要的事情说三遍)直接进入第四步!

    4、打开Finder前往文件夹,或者直接快捷键command+shift+G并输入下面路径
    ~/Library/Group Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets/TemporaryItems/MobileApps/


    可以看到我们需要的包,这个时候拷贝出来(一定要拷贝出来),然后回到第三步点击【停止】会发现刚才目录下的文件也消失了!

     copy缓存中的IPA包到其他的目录

     点击停止内容消失


    5、拿到包后,可以用IPA做ios的自动化测试

    #!/usr/bin/env python
    # -*-coding:utf-8-*=


    import os
    import unittest
    from appium import webdriver
    from time import sleep


    class TestSample(unittest.TestCase):
    def setUp(self):

    self.driver = webdriver.Remote(
    command_executor='http://127.0.0.1:4723/wd/hub',
    desired_capabilities=
    {
    "automationName": "XCUITest",
    "platformName": "iOS",
    "deviceName": "iPhone 7",
    "platformVersion": "12.0",
    "app": "/Users/qiuyunxia/yunxia.qiu/code/IPA/test.ipa",
    "bundleId": "com.mobvista.ui.test",
    "noReset": True,
    "udid": "2264c37ef756e8a3c3339097f92a420ed8656375"
    }
    )

    def tearDown(self):

    self.driver.quit()

    def testSample(self):
    sleep(2)
    ir = self.driver.find_element_by_name("InterActive Ad")
    print(ir.text)
    print(ir.tag_name)
    try:
    self.driver.find_element_by_name("InterActive Ad").click()
    sleep(3)
    self.driver.get_screenshot_as_file('screen.png')
    except:
    print("no element")

    pass

    # def testSample01(self):
    # pass


    if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(TestSample)
    unittest.TextTestRunner(verbosity=2).run(suite)
  • 相关阅读:
    Python学习札记(十五) 高级特性1 切片
    LeetCode Longest Substring Without Repeating Characters
    Python学习札记(十四) Function4 递归函数 & Hanoi Tower
    single number和变体
    tusen 刷题
    实验室网站
    leetcode 76. Minimum Window Substring
    leetcode 4. Median of Two Sorted Arrays
    leetcode 200. Number of Islands 、694 Number of Distinct Islands 、695. Max Area of Island 、130. Surrounded Regions 、434. Number of Islands II(lintcode) 并查集 、178. Graph Valid Tree(lintcode)
    刷题注意事项
  • 原文地址:https://www.cnblogs.com/dreamhighqiu/p/11016086.html
Copyright © 2011-2022 走看看