• ios 11.4 真机调试包

    2020-06-24 11:24:00
    iOS 开发没有必要非要更新新的开发工具xcode才能够真机调试的,这是一个iOS11.4 版本 支持包,放在Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 即可
  • 存放路径:Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
  • Xcode7.3.1真机测试运行iOS10以上随着iOS10 和xcode8的推出,等了一段时间,才打算升级iOS10和xcode8,不过升级完之后才发现,我公司的老项目里包含之前大神用的Swift2.3的核心框架,找了好久也没有找到可以代替的...

    Xcode7.3.1真机测试运行iOS10以上

    随着iOS10 和xcode8的推出,等了一段时间,才打算升级iOS10和xcode8,不过升级完之后才发现,我公司的老项目里包含之前大神用的Swift2.3的核心框架,找了好久也没有找到可以代替的东西。刚好公司打算重新架构,也就开始一边维护一边重新开发了。
    所以我在mac上安装了两个xcode,分别是8和7.3.1,7.3.1用来维护旧工程,8用来开发新的。
    可是手机升级后xcode7.3.1就毫无反应了,后来将10.0.0的测试包导入后已是不行
    

    这里写图片描述

    1.手机系统显示为10.0.2....顿时日了)狗了(----,心都哇凉哇凉的---,后来又将Developer里面的SDK改了下就可以运行啦
    

    这里写图片描述

    2.原来的是iPhoneOS9.3的,我给改成xcode8里面的10.0了,还是不好使。
    

    这里写图片描述

    3. 后来我把两个都加上了,嘿嘿 证明结果还是OK的
    4.本来打算附上链接可是这两个东西是替身
    

    SKDS的压缩文档

    展开全文
  • appium在真机运行IOS实例要注意的几点,appium,java ,python,运行实例和关键代码

    最近在研究appium对于IOS的自动化测试,发现在真机上运行appium提供的开源的例子遇到了几个block,询问了一个这个方便面的高手并且总结网上搜到的帖子,现在综合一下。

    appium 在模拟器中跑,只需要注意:

    1:app=path找到编译后app所在的位置,如:注意Release-iphonesimulator这个是模拟器编译后的文件夹

        final File appDir = new File(System.getProperty("user.dir"),
            "../../../apps/TestApp/build/Release-iphonesimulator");
        final File app = new File(appDir, "TestApp.app");
        capabilities.setCapability("app", app.getAbsolutePath());

    appium真机上运行:

    1:运行的时候要将APP安装到真机上面

    2:运行的时候,不能再开instrument 

    3:命令行里面启动的时候,参数写错了应该是 appium -U 3d2cad7288a64a5445aa98a2cc220132f2cddd1c --app io.appium  然后代码里面 app=bundleID,如以下例子中:  capabilities.setCapability("app", "io.appium.TestApp");而不是那个很长的路径,其中-U 参数后面是真机的uuid,可以打开xcode,在windows下的organise下找到,一般mac连接上ipad后会有绿色圆点



    现在贴上真机上运行python实例:

    Kingsons-MacBook:Study kingson$ appium -U 1a601f5cd791bc379115095fc81cd69b096582a3 --app com.telenavsoftware.doudouy
    info: Welcome to Appium v0.11.4 (REV b04decd191002628c88e9bf475553da1cd04a036)
    info: Appium REST http interface listener started on 0.0.0.0:4723
       info  - socket.io started
    debug: Appium request initiated at /wd/hub/session
    debug: Request received with params: {"sessionId":null,"desiredCapabilities":{"device":"iPhone Simulator","platform":"Mac","browserName":"iOS","version":"7.0","app":"com.telenavsoftware.doudouy"}}
    info: App is an iOS bundle, will attempt to run as pre-existing
    info: Creating new appium session a36fdf63-9b22-48a4-bb01-4b44ddb54aff
    info: Removing any remaining instruments sockets
    info: Cleaned up instruments socket /tmp/instruments_sock
    info: Cleaning up any tracedirs
    info: No tracedirs to clean up
    info: Localizable.strings is not currently supported when using real devices.
    info: Not setting device type since we're connected to a device
    info: Starting iOS device log capture via idevicesyslog
    debug: Real device specified but no ipa, assuming bundle ID is on device
    debug: Creating instruments
    info: instruments is: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
    info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
    info: Attempting to run app on real device with UDID 1a601f5cd791bc379115095fc81cd69b096582a3
    info: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w 1a601f5cd791bc379115095fc81cd69b096582a3 com.telenavsoftware.doudouy -e UIASCRIPT /usr/local/lib/node_modules/appium/lib/devices/ios/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments/
    info: And extra without-delay env: {}
    info: And launch timeout: 90000ms
    info: [INST STDERR] 2013-12-10 10:40:22.536 instruments[53424:507] Connection to the remote device lost while launching target. Aborting...
    
    info: [INST STDERR] 2013-12-10 10:40:22.539 instruments[53424:507] Recording cancelled : At least one target failed to launch; aborting run
    
    info: [INST STDERR] Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7ff6d308f220 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
    Instruments Trace Error : Failed to start trace.
    
    info: [INSTSERVER] Instruments exited with code 253
    error: Instruments did not launch successfully, failing session
    info: Cleaning up appium session
    error: Failed to start an Appium session, err was: Error: Instruments did not launch successfully--please check your app paths or bundle IDs and try again
    info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments did not launch successfully--please check your app paths or bundle IDs and try again)","origValue":"Instruments did not launch successfully--please check your app paths or bundle IDs and try again"},"sessionId":null}
    POST /wd/hub/session 500 6015ms - 342b```
    
    我的部分代码片段:
    
    
    ```python
    class TestSequenceFunctions(unittest.TestCase):
    
        def setUp(self):
            # set up appium
            app = "com.telenavsoftware.doudouy"
            #app = os.path.join(os.path.dirname(__file__),
            #                   '../../apps/DDY/build/',
            #                   'DouDouY.app')
            #app = os.path.abspath(app)
            self.driver = webdriver.Remote(
                command_executor='http://127.0.0.1:4723/wd/hub',
                desired_capabilities={
                    'browserName': 'iOS',
                    'device': 'iPhone Simulator',
                    'platform': 'Mac',
                    'version': '7.0',
                    'app': app
                })```
    1.启动Appium时,保证你的Real Device的UDID和你的应用的Bundle ID正确
    2.确保你的应用可以安装到你的真机上
    3.安装后请断开与Xcode的连接
    4.确保Mac上没有启动Instruments工具


    以下是JAVA真机运行log:

    devexus-iMac:build devexu$ appium -U 3d2cad7288a64a5445aa98a2cc220132f2cddd1c --app io.appium

    info: Welcome to Appium v1.1.0 (REV e433bbc31511f199287db7724e1ce692bcb32117)

    info: Appium REST http interface listener started on 0.0.0.0:4723

    info: socket.io started

    info: Non-default server args: {"app":"io.appium","udid":"3d2cad7288a64a5445aa98a2cc220132f2cddd1c"}

    debug: Appium request initiated at /wd/hub/session

    debug: Request received with params: {"desiredCapabilities":{"platformVersion":"7.1","app":"io.appium.TestApp","platformName":"iOS","deviceName":"iPhone Simulator","browserName":""}}

    info: App is an iOS bundle, will attempt to run as pre-existing

    info: Creating new appium session 2bcd619b-b7fb-45f5-b20c-79caff8cd24f

    info: Removing any remaining instruments sockets

    info: Cleaned up instruments socket /tmp/instruments_sock

    info: Cleaning up any tracedirs

    info: No tracedirs to clean up

    info: Setting Xcode folder

    info: Setting Xcode version

    info: Setting iOS SDK Version

    info: iOS SDK Version set to 7.1

    info: Detecting automation tracetemplate

    info: Not auto-detecting udid, running on sim

    info: Localizable.strings is not currently supported when using real devices.

    info: Not setting locale because we're using a real device

    debug: Creating instruments

    info: Not setting iOS and app preferences since we're on a real device

    info: Starting iOS device log capture via idevicesyslog

    info: Not setting device type since we're connected to a device

    debug: Real device specified but no ipa or app path, assuming bundle ID is on device

    debug: Starting instruments

    info: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

    info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock

    info: Attempting to run app on real device with UDID 3d2cad7288a64a5445aa98a2cc220132f2cddd1c

    info: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w 3d2cad7288a64a5445aa98a2cc220132f2cddd1c io.appium.TestApp -e UIASCRIPT /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments

    info: And extra without-delay env: {}

    info: And launch timeouts (in ms): {"global":90000}

    info: [INST] 2014-07-02 01:29:30 +0000 Start: Bootstrapping uiauto

           

    info: [INST] 2014-07-02 01:29:32 +0000 Start: Got user: devexu

           

    info: [INST] 2014-07-02 01:29:33 +0000 Start: Not using settings file.

           

    info: [INST] 2014-07-02 01:29:33 +0000 Start: isVerbose:false

           

    info: [INST] 2014-07-02 01:29:37 +0000 Start: Using node at: /usr/local/bin/node

           

    info: [INSTSERVER] Instruments is ready to receive commands

    info: Instruments launched. Starting poll loop for new commands.

    info: Setting bootstrap config keys/values

    info: Pushing command to appium work queue: "setBootstrapConfig: autoAcceptAlerts=false"

    debug: Sending command to instruments: setBootstrapConfig: autoAcceptAlerts=false

    info: [INSTSERVER] Socket data received (15 bytes)

    info: [INSTSERVER] Socket data being routed for 'cmd' event

    info: [INSTSERVER] Sending command to instruments: setBootstrapConfig: autoAcceptAlerts=false

    info: [INSTSERVER] Socket data received (48 bytes)

    info: [INSTSERVER] Socket data being routed for 'cmd' event

    info: [INSTSERVER] Got result from instruments: {"status":0,"value":""}

    info: Setting initial orientation to PORTRAIT

    info: Pushing command to appium work queue: "au.setScreenOrientation('PORTRAIT')"

    debug: Sending command to instruments: au.setScreenOrientation('PORTRAIT')

    info: [INSTSERVER] Sending command to instruments: au.setScreenOrientation('PORTRAIT')

    info: [INST] 2014-07-02 01:29:41 +0000 Debug: target.setDeviceOrientation("1")

           

    info: [INSTSERVER] Socket data received (56 bytes)

    info: [INSTSERVER] Socket data being routed for 'cmd' event

    info: [INSTSERVER] Got result from instruments: {"status":0,"value":"PORTRAIT"}

    info: Device launched! Ready for commands

    info: Setting command timeout to the default of 60 secs

    info: Appium session started with sessionId 2bcd619b-b7fb-45f5-b20c-79caff8cd24f

    POST /wd/hub/session 303 22483ms - 9b

    debug: Appium request initiated at /wd/hub/session/2bcd619b-b7fb-45f5-b20c-79caff8cd24f

    debug: Request received with params: {}

    info: Responding to client with success: {"status":0,"value":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"warnings":{},"desired":{"platformVersion":"7.1","app":"io.appium.TestApp","platformName":"iOS","deviceName":"iPhone Simulator","browserName":""},"platformVersion":"7.1","app":"io.appium.TestApp","platformName":"iOS","deviceName":"iPhone Simulator"},"sessionId":"2bcd619b-b7fb-45f5-b20c-79caff8cd24f"}

    ..........

    java真机运行的代码:

    package com.saucelabs.appium;


    import static org.junit.Assert.assertTrue;
    import io.appium.java_client.AppiumDriver;
    import io.appium.java_client.MobileBy;


    import java.net.URL;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;


    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import org.openqa.selenium.By;
    import org.openqa.selenium.Dimension;
    import org.openqa.selenium.Point;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.CapabilityType;
    import org.openqa.selenium.remote.DesiredCapabilities;


    /**
     * Simple <a href="https://github.com/appium/appium">Appium</a> test which runs
     * against a local Appium instance deployed with the 'TestApp' iPhone project
     * which is included in the Appium source distribution.
     * 
     * @author Ross Rowe
     */
    public class WiMyOffice {


      private AppiumDriver     driver;


      private List<Integer>    values;


      private static final int MINIMUM = 0;
      private static final int MAXIMUM = 10;


      private Point getCenter(final WebElement element) {


        final Point upperLeft = element.getLocation();
        final Dimension dimensions = element.getSize();
        return new Point(upperLeft.getX() + dimensions.getWidth() / 2,
            upperLeft.getY() + dimensions.getHeight() / 2);
      }


      private void populate() {
        // populate text fields with two random number
        final List<WebElement> elems = driver.findElements(By
            .className("UIATextField"));
        final Random random = new Random();
        for (final WebElement elem : elems) {
          final int rndNum = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM;
          elem.sendKeys(String.valueOf(rndNum));
          values.add(rndNum);
        }
      }


      @Before
      public void setUp() throws Exception {
        // set up appium


        final DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
        capabilities.setCapability("platformVersion", "7.1");
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("deviceName", "iPhone Simulator");
        capabilities.setCapability("app", "io.appium.TestApp");
        driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);
        values = new ArrayList<Integer>();
      }



      @After
      public void tearDown() throws Exception {
        driver.quit();
      }


      @Test
      public void testHideKeyboard() throws Exception {
        driver.findElement(By.xpath("//UIATextField[1]")).sendKeys("12");


        final WebElement button = driver.findElement(MobileBy
            .AccessibilityId("Done"));
        assertTrue(button.isDisplayed());


        button.click();
      }


    }


    java上在模拟器上跑的实例:

    命令行输入:appium &启动服务就可以了

    lsof -i:4723查看端口号有没有被占用,占用就用 kill -9 进程ID

    代码:

    package com.saucelabs.appium;


    import static org.junit.Assert.assertTrue;
    import io.appium.java_client.AppiumDriver;


    import java.io.File;
    import java.net.URL;
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Random;


    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import org.openqa.selenium.By;
    import org.openqa.selenium.Dimension;
    import org.openqa.selenium.Point;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.remote.CapabilityType;
    import org.openqa.selenium.remote.DesiredCapabilities;


    /**
     * Simple <a href="https://github.com/appium/appium">Appium</a> test which runs
     * against a local Appium instance deployed with the 'TestApp' iPhone project
     * which is included in the Appium source distribution.
     * 
     * @author Ross Rowe
     */
    public class SimpleTest {


      private AppiumDriver     driver;


      private List<Integer>    values;


      private static final int MINIMUM = 0;
      private static final int MAXIMUM = 10;


      private Point getCenter(final WebElement element) {


        final Point upperLeft = element.getLocation();
        final Dimension dimensions = element.getSize();
        return new Point(upperLeft.getX() + dimensions.getWidth() / 2,
            upperLeft.getY() + dimensions.getHeight() / 2);
      }


      private void populate() {
        // populate text fields with two random number
        final List<WebElement> elems = driver.findElements(By
            .className("UIATextField"));
        final Random random = new Random();
        for (final WebElement elem : elems) {
          final int rndNum = random.nextInt(MAXIMUM - MINIMUM + 1) + MINIMUM;
          elem.sendKeys(String.valueOf(rndNum));
          values.add(rndNum);
        }
      }


      @Before
      public void setUp() throws Exception {
        // set up appium
        final File appDir = new File(System.getProperty("user.dir"),
            "../../../apps/TestApp/build/Release-iphonesimulator");
        final File app = new File(appDir, "TestApp.app");
        final DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
        capabilities.setCapability("platformVersion", "7.1");
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("deviceName", "iPhone Simulator");
        capabilities.setCapability("app", app.getAbsolutePath());
        driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),
            capabilities);
        values = new ArrayList<Integer>();
      }


      @After
      public void tearDown() throws Exception {
        driver.quit();
      }


      @Test
      public void testActive() throws Exception {
        final WebElement text = driver.findElement(By.xpath("//UIATextField[1]"));
        assertTrue(text.isDisplayed());


        final WebElement button = driver.findElement(By.xpath("//UIAButton[1]"));
        assertTrue(button.isDisplayed());
      }
     
    }

    展开全文
  • iOS11.4 developer disk image

    2020-05-26 23:30:20
    升级iOS11.4 后,Xcode9.2运行程序到真机报错,提示Could not find developer disk image,Xcode Device栏处的真机右侧显示“(unavailable)”,手机系统版本iOS11.4,Xcode 9.2从Xcode 10 beta中抽取的文件添加到...
  • iOS工程真机运行报错: 真机并未锁屏或者设置为不信任次计算机,但是模拟器可以正常运行: 问题根源在于: 手动配置描述文件时,描述文件选错了! 在真机上build应该选择开发用描述文件,不是发布类描述文件...

    iOS工程真机运行报错:

    真机并未锁屏或者设置为不信任次计算机,但是模拟器可以正常运行:

    问题根源在于:

    手动配置描述文件时,描述文件选错了!

    在真机上build应该选择开发用描述文件,不是发布类描述文件!

    描述文件选择正确后,调试运行即正常!

     

    展开全文
  • 一个iOS项目,今天第一次用Xcode11打开,出现了若干错误,逐一修复后,编译运行,App可耻的崩鸟… 调试发现崩溃出现在如下一行中: 这个在之前的Xcode10中运行是没有问题的,那么可能的原因就是新的Swift运行时在...

    好久没写Blog了,今天来一发

    一个iOS项目,今天第一次用Xcode11打开,出现了若干错误,逐一修复后,编译运行,App可耻的崩鸟…

    在这里插入图片描述

    调试发现崩溃出现在如下一行中:

    在这里插入图片描述

    这个在之前的Xcode10中运行是没有问题的,那么可能的原因就是新的Swift运行时在运行检查时更加严格了,在新的Swift runtime中hashValue返回的值超出了Int32可表示的范围。

    做个测试:

    在这里插入图片描述

    显然在之前的Runtime中返回的结果一定是小于Int32.max的,所以运行不会崩溃。

    因为id与数据库中的表字段对应,如果要修改成64位,势必要改动数据库的表结构,所以这里用一个临时的办法规避:

    let id = Int32(truncatingIfNeeded: UUID().hashValue)
    

    在这里插入图片描述

    That’s all,谢谢观赏 😉

    展开全文
  • 根据网上教程设置https://blog.csdn.net/foreverling_ling/article/details/56671458在我设置的过程中出现的一些小问题(通过网上的一些教程解决的):1.Failed to create provisioning profile....

    根据网上教程设置

    https://blog.csdn.net/foreverling_ling/article/details/56671458

    在我设置的过程中出现的一些小问题(通过网上的一些教程解决的):

    1.Failed to create provisioning profile. The app ID "..." cannot be registered to your development team...

    解决方法:新建一个project 将team改成苹果ID中的team 然后进入它的General页面,将它的Boundle Identifier复制出来,贴到Boundle Identifier中就行了


    2.This iPhone 6 is running iOS 11.4 (15F79), which may not be supported by this version of Xcode.

    解决方法:上网搜索对应的iOS真机测试文件 然后将对应的文件复制粘贴在 

    Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 路径下即可。

    百度云盘资源(含11.0 11.1 11.2 11.3 11.4 ):链接:https://pan.baidu.com/s/1U8PX6PLK1U5KWaTYVo4a9w  密码:xy2v


    3.iPhone is busy:Preparing debugger support for iPhone 

    解决方法:重启Xcode和iphone

    展开全文
  • Having x86_64 code is not sufficient to distinguish if a binary is intended for the iOS Simulator, a macOS app, or a Mac Catalyst app. Combing built binaries across different destinations (which ...
  • Appium不能启动iOS真机

    2019-04-10 13:20:00
    warn: Could not capture device log using libimobiledevice idevicesyslog. Libimobiledevice probably isn't installed error: Could not initialize ideviceinstaller; make sure it is installed and works on...
  • 错误1:Building for iOS Simulator, but the linked framework 'CocoaAsyncSocket.framework' was built for tvOS + tvOS Simulator. 解决:因为我是只测试IOS,所以直接删掉了,删掉后默认就加载的是IOS的了。 ...
  • 用xcode11.5 创建的swift 工程,用模拟器运行一切正常,真机iOS10 的系统版本,发现运行不了,报了一堆的错 这是因为现在多了一个SceneDelegate.swift,启动完成后在这里创建应用视图 1.解决视图报错,...
  • 今天突然发现真机调试一直显示连接失败,因为之前使用了无线调试模式,所以真机图标一直存在,但是打开Devices And Simulators查看真机却一直处于Disconnect状态,重启Xcode、重启手机、重启电脑全部没用,最后通过...
  • iOS 11开发教程(九)iOS11数据线连接真机测试 在Xcode 7.0之后,苹果公司在开发许可权限上做了很多的改变,在测试App方面取消了一些限制。在Xcode7.0之前的版本,苹果公司只向注册过的开发者帐号(99美金收费帐号...
  • iOS 11不显示appicon

    2017-11-17 13:18:23
    问题:使用了CocoaPods的Xcode工程,在iOS11的手机上AppIcon不显示 原因:CocoaPods的资源编译脚本在iOS11下出了点问题.需要修改脚本. 两种修改方式: 1.在Podfile添加脚本修改: 1). 在Podfile 添加如下代码.post...
  • 升级手机系统后,xcode真机调试遇到:Could ...This iPhone 6s is running iOS 11.4(15F5037c), which may not be supported by this version of Xcode.不升级Xcode的解决方法:1、显示包内容(/Applications/Xcode....
  • No code signature found

    2017-06-27 10:32:06
    今天新建了一个项目,然后想真机运行的时候,出现了No code signature found,没搞明白是怎么回事,然后上网找资料,谷歌百度都没有找到有效的答案,只能用模拟器运行,但是另外新建的项目就可以真机运行,以为是...
  • 在日常测试中会遇到code signing is required for product type 'xxxxx' in SDK 'iOS 10.3' ,具体如下 解决方法按照以下步骤依次设置,clean再运行
  • 之前Flutter项目都妥妥的,升级Xcode11.4后却报错。 error: Building for iOS, but the linked and embedded framework 'App.framework' was built for iOS Simulator. (in target 'Runner' from project 'Runner') ...
1 2 3 4 5 6
收藏数 109
精华内容 43
关键字:

11.4真机运行 ios