zoukankan      html  css  js  c++  java
  • 【问题汇总】

    背景:苹果2015年WWDC后发布了iOS9和XCode7系列,对于开发者的一点好处是

    真机调试不在需要那美圆的账号了,真机调试免费了!

    简单总结准备步骤:
    1. 进入xcode,菜单栏选择xcode –> preferences ,在Accounts选项卡添加自己的Apple ID。

    2. 在项目导航栏中选择要真机调试的项目,在工作区的targets选择要测试的项目。(点击项目名称)。

    3. 选择General选项卡,展开Identity项,修改下面的team选项为你刚才添加的Apple ID。

    4. 把你需要真机调试的设备连上电脑。(点击window->devices查看是否添加了设备)。


    5. 在刚才team选项的下面此时多了一个警告,点击Fix Issue,等待xcode处理完,这个警告就消失了。

    6.运行版本修改至宽的范围,Deployment Target 改为比手机版本小数字(这表示从这个版本往上的版本都支持)


    现在你可以在你的设备上真机调试了,无需开发者帐号。

    常见真机调试的问题:

    1.Verify the Developer App certificate for your account is trusted on your device. Open Settings on WBiPhone7 and navigate to General -> Device Management, then select your Developer App certificate to trust it.在您的设备上验证您的帐户的开发应用程序证书。打开设置在wbiphone7导航一般->设备管理,然后选择你的开发应用证书信任它。

    2.关于手机升级iOS10.2之后无法真机调试的解决

    1.直接在网上搜索对应手机版本的真机调试包.如搜索10.2.1真机调试包.

    2.下载好的真机调试包里面有2个文件,

    3. 右击Xcode.app显示包文件,把下载好的安装包放在这个路径下即可

    /Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

    重启xcode即可真机调试.

    3. 

    Xcode8用模拟器运行项目,会打出一堆日志,例如:

    subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
    subsystem: com.apple.UIKit, category: HIDEventIncoming, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
    subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
    subsystem: com.apple.UIKit, category: StatusBar, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
    subsystem: com.apple.BackBoardServices.fence, category: App, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0

    对我们没多大作用,可以屏蔽。

    2419179-2d3e69d8ba196d46.png

    product ->scheme -> EditScheme -> Run -> Arguments
    在Environment Variables一栏中添加OS_ACTIVITY_MODE并设值为disable,注意打勾。

    解决真机调试NSLog没输出

    iOS 10真机调试的话,会屏蔽掉NSLog。如果NSLog宏定义是这样的话:
    #define NSLog(format, ...) NSLog(format, ## __VA_ARGS__)
    在完成OS_ACTIVITY_MODE设置后会发现真机调度时NSLog不输出了。
    所以需要定义成另一个函数来输出,例如printf()

    NSLog宏定义的写法很多,这里贴上我的写法:

    #ifdef DEBUG
    #define NSLog(format, ...) printf("
    [%s] %s [第%d行] %s
    ", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
    #else
    #define NSLog(format, ...)
    #endif

    测试:

    NSLog(@"初始化完毕");NSLog(@"测试NSLog:%@", @"OK");

    效果:

    [19:47:57] -[ViewController viewDidLoad] [第26行] 初始化完毕
    
    [19:47:57] -[ViewController TestLog] [第31行] 测试NSLog:OK
    4.

    Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255. The tool may have crashed. Please file a bug report at http://bugreport.apple.com with the above output and attach any crash logs for ibtool, ibtoold, Xcode, and Interface Builder Cocoa Touch Tool created around the time of this failure. These logs can be found in ~/Library/Logs/DiagnosticReports or /Library/Logs/DiagnosticReports.

    这个基本意思就是需要你清除一下缓存,shift+ com + K, ok了.

     

     5.Could not find a storyboard named ‘Main’ in bundle NSBundle 

    其实是因为我在加载时将main.storyboard删除了 

    在这里设置成launchScreen加载就行啦

    appdelegate再去设置自己的根视图 

    
    

    https://blog.csdn.net/simona_1973/article/details/78861900

    6.iOS开发之duplicate symbols for architecture x86_64错误

    分析错误原因

    仔细读一下报错原因可以发现几个关键词:"duplicate"和"symbols"。

    duplicate的中文意思是“重复的、复制的”,而symbols的意思是“符号”。也就是可能在你工程中引入了重复的东西。

    找到重复的文件,删除一份即可.

    7.

    终端命令;

    sudo rm -r -f 文件夹名

    mac中如何从vim文本编辑器退回到命令

    有的时候,我们经常从命令行中进入vim文本编辑器,如何退回来呢:

    只需要经过两步:1.按下esc键  2.输入":wq"(保存退出)  输入":q!"(不保存退出)

    8.Could not find a storyboard named 'Main' in bundle NSBundle </Users/liuyuhang/Library/Developer/Core

    https://blog.csdn.net/simona_1973/article/details/78861900

    IOS真机调试中遇到的问题:

    1.

    Reason: no suitable image found.

    证书问题,把证书和描述文件删掉在重新下载重新配置一遍就ok了

  • 相关阅读:
    eclipse添加xsd
    Ibatis 后台打印完整的sql语句
    eclipse 将文件夹作为sourcefolder
    git:hook declined FATAL: W refs/heads DENIED by fallthru error
    单点登陆CAS安装过程中可能遇到的问题
    单点登录的原理与CAS技术的研究
    【转载】软件开发模式对比(瀑布、迭代、螺旋、敏捷)
    UML工具选择
    UML 用例图,时序图,活动图的定义以及区别
    基于UML的需求分析和系统设计个人体会
  • 原文地址:https://www.cnblogs.com/wangbinios/p/10177713.html
Copyright © 2011-2022 走看看