【iOS】真機調試問題總結 錯誤集合


該文章轉載於CSDN某俠客,純屬學習,原文鏈接:http://blog.csdn.net/luyuncsd123/article/details/25028803

1. 編譯iPad真機時,選擇了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad.

若編譯出現如下錯誤:

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

則修改 GCC4.2CodeGeneral區域中的ComplieForThumb爲非選中.

已經有了開發者證書及私鑰後,可直接在越獄的手機上調試.

 

2. 編譯鏈接時, "_OBJC_CLASS_$_xxx", referenced from:可能需要重新建立某個類的文件.

    或者:選擇項目名,在detail列表中的target列(顯示爲一個又圓圈),把這個文件的複選選中,或者再次選中.以把它加入到這個target裏面來.

 

3.在sdk4.0及以上使用RegexKitLite報'captureCount' was not declared in this scope錯誤,是在非.m文件中使用了它的原因.

   http://www.cocoachina.com/bbs/read.php?tid=38784&page=e&#a

 

4.there is no sdk with the name or path.

   從網上down的開源代碼,結果運行的時候常出現這樣的錯,並且在deployment中沒有ios deployment target 選項.

   http://blog.aztaru.com/2010/10/05/ios%E7%AD%86%E8%A8%98there-is-no-sdk-error/

   嘗試 Project/Edit Active Target/ 及 Set Active SDK菜單項,來回切換一下Active Configuration。

 

5.常見的EXEC_BAD_ACCESS,EXC_BAD_INSTRUCTION錯誤,一般是因爲訪問已經被release的對象造成的。

在工程中加入NSZombieEnabled 環境變量,並設爲啓用,則在 EXC_BAD_ACCESS 發生時,XCode 的 Console 會打印出問題描述中,設置方法:雙擊Executables 下的 可執行模組,在彈出窗口中,Variables to be set in the environment,添加 NSZombieEnabled,並設定爲 YES,點擊選中複選框啓用此變量。

可以再加入 MallocStackLogging 來啓用malloc記錄,以獲得更多的提示來幫助定位問題。

在gdb窗口輸入 (格式: shell   malloc_history <id>   <address>)    shell malloc_history 14360x5f7fcf0, 也可以在終端中去運行 就要去掉以上的shell 指令 如 malloc_history <id>   <address>

http://www.cocoachina.com/macdev/objc/2011/0219/2661.html

http://www.cnblogs.com/likwo/archive/2011/02/10/1950664.html

應該僅當需要調試內存時,才設置上述環境變量.


在xcode4中,To edit environment variables, go to Menu Product / Edit Scheme…, select the desired configuration (you probably want 'Run') from the left sidebar first and then click on the Arguments tab. Environment variables are configurable there.

 

6.運行一個IPhone程序時,彈出窗口說“程序運行失敗,預置描述文件已過期” 。 解決辦法是,在Xcode中, window-> Orgnazier -> 你的iphone ->刪除帶有紅*的該程序之前的Profile 。 然後從Xcode運行該程序.


7. 真機編譯時報 Code Sign error: The identity doesn't match any valid certificate/private key pair in the default keychain

    修改工程和Targets的get info\build 中的code signing identity爲空


8.調試打印

   CFShow(coreFoundationThingy) will print out a description of coreFoundationThingy to the console. Output looks something like: {value = w:1186.000000 h:687.000000 type = kAXValueCGSizeType}
   If NSLog() is printing something out as an NSCFType, try CFShow().

 

9. 編譯時報 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1,修改C/C++ Compiler Version爲gcc4.2


10.this class is not key value coding-compliant for the key viewController

可能在創建了一個基於view的工程,而後把生成的viewcontroller刪除了,但是在.xib中還有對它的引用,在IB中直接用delete鍵刪除掉它就行了。


11.這臺電腦上已經存在一個名爲“embedded.mobileprovision”的預置文件,您是否要替換麼?

http://blog.sina.com.cn/s/blog_6907b67f0100o2vw.html


12.真機調試時報failed to upload *.app

http://hi.baidu.com/%CB%E6%B7%E7_1989/blog/item/9649f49f805f05aec8eaf466.html

http://www.shouyanwang.org/thread-462-1-1.html


13.記的release時,先置delegate爲nil。


14.模擬器

     將xcode升級到4.3.1以後發現,ipad的模擬器,沒有Home鍵了。Command+Shift+H就可以實現類似點擊Home鍵的效果了。


How to “add existing frameworks” in Xcode 4?

  1. In the project navigator, selectyour project
  2. Select your target
  3. Select the 'Build Phases' tab
  4. Open 'Link Binaries With Libraries'expander
  5. Click the '+' button
  6. Select your framework
  7. (optional) Drag and drop the addedframework to the 'Frameworks' group

15.如何在Xcode 4.2 下進行 iPod touch 2代、iPhone 3G等設備的真機調試?
     http://dev.ppios.com/2012/02/%E5%A6%82%E4%BD%95%E5%9C%A8xcode-4-2-%E4%B8%8B%E8%BF%9B%E8%A1%8C-ipod-touch-2%E4%BB%A3%E3%80%81iphone-3g%E7%AD%89%E8%AE%BE%E5%A4%87%E7%9A%84%E7%9C%9F%E6%9C%BA%E8%B0%83%E8%AF%95%EF%BC%9F/


16.編譯真機提示provising文件找不到,到project.pbxproj中,把那串標識值刪除。


17.在xcode4.3上連接裝有ios4.2的3gs,提示: Xcode has encountered an unexpected error (0xC002)
No such file or directory, at ‘/SourceCache/DTDeviceKit/DTDeviceKit-1196/DTDeviceKit/DTDeviceKit_Utilities.m:798’

     http://stackoverflow.com/questions/7922308/xcode-4-2-error-0xc002-when-trying-to-use-a-jailbroken-iphone-3g-for-develop

cd ~/Library/Developer/Xcode/iOS\ DeviceSupport/4.2.1\ 8C148a/Symbols/System/Library/Caches/com.apple.dyld/
touch .copied_dyld_shared_cache_armv6
touch .processed_dyld_shared_cache_armv6
touch dyld_shared_cache_armv6
或 
touch .copied_dyld_shared_cache_armv7
touch .processed_dyld_shared_cache_armv7
touch dyld_shared_cache_armv7


18. xcode4添加調試斷點  
     在Xcode左側斷點管理窗口(Command+6)中,點擊左下角+,添加add symbolic breakpoint,輸入objc_exception_throw,點擊done;然後右鍵單擊該斷點選擇move breakpoint to,選擇項目名或User,即可以在所有項目中起作用。
    還可添加輸入malloc_error_break的symbolic斷點,以跟蹤調試釋放了2次的對象。


19.XCode內置GDB,調試時在輸出窗口中使用GDB命令來調試程序。

     po 命令:爲 print object 的縮寫,顯示對象的文本描述(顯示從對象的 description 消息獲得的字符串信息)。

     print 命令:有點類似於格式化輸出,可以輸出對象的不同信息:

     info 命令:我們可以查看內存地址所在信息

     show 命令:顯示 GDB 相關的信息。如:show version 顯示GDB版本信息

     help 命令:如果忘記某條命令的語法了,可以使用 help 命令名 來獲取幫助信息。如:help info 顯示 info 命令的用法。


20.NSLog

    真機上NSLog會消耗資源,

    以release模式編譯的程序不會用NSLog輸出,而以debug模式編譯的程序將執行NSLog的全部功能。

#ifndef __OPTIMIZE__
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define NSLog(...)
#endif


#ifdef __OPTIMIZE__
#define NSLog(...) 
#endif

  這個代碼的魔術在於:release模式通常會定義 __OPTIMIZE__,debug模式不會。將這段代碼放在頭文件當中,就可以放心的使用NSLog了!

  把這些代碼放到*Prefix.pch中最省事。可以把這段宏定義放到一個頭文件中,再把這個頭文件包含到*Prefix.pch中。

    http://lichen1985.com/blog/?p=251

   iOS中日誌打印:

   自定義NSLog  #define NSLog NSLog(@"#%s##%d#",strrchr(__FILE__,'/'),__LINE__);NSLog,例如NSLog(@" begin main function"); 打印出來如下 #/main.mm##30# begin main function

   參考 http://xcodev.com/wordpress/?m=201204


21. 錯誤日誌目錄在Mac OS X: ~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>


      iOS Exception caught Crash Report,3種方法

      http://blog.sina.com.cn/s/blog_67b7cb7b010146qj.html

      在iPhone上捕獲軟件異常退出的信息,2種方法

      http://hi.baidu.com/coolwidy/blog/item/76f006896168ecb80f2444e7.html

      PLCrashReporter

      http://caydenliew.com/2011/11/plcrashreporter-the-iphone-crash-framework/

  

     http://blog.sina.com.cn/s/blog_60b45f230100tn5b.html


22. Certificate identity 'iPhone Developer: XXXXXXXX' appears more than once in the keychain. The codesign tool requires there only be one
       出錯原因:多次爲同一個計算機生成私有證書,並且每次都生成了proversionning文件,下載並按照到同一個iOS設備上,那麼再次編譯程序到設備上的時候就會出現這個問題。
      修改方法:在Xcode中,選擇菜單Window->Organizer,在LIBRARY下面,選擇Provisioning Profiles.找到前面幾次生成的Provisioning profiles.刪除。
                        在系統的keychains,即鑰匙串管理程序中,在登錄下面,我的證書,刪除早期的私有證書。
                        再次編譯


23.在 iOS 設備上測試你的應用

     http://www.guomii.com/posts/20637

     如果你已加入 iOS 開發者計劃,你現在就可以使用 Xcode 進行真機運行、測試和調試了,直接在xcode4中操作。

     當你將一臺安裝了有效描述文件的設備,連接到 Mac 上時,這臺設備的名稱以及當前系統版本會出現在Edit Scheme的Destination 菜單中。


24.error: failed to launch '/Users/gzty1/Library/Developer/Xcode/DerivedData/TianyaQing-chiobhpmbvwnqudfqnfawdzjrtey/Build/Products/Debug-iphoneos/TianyaQing.app/TianyaQing' -- failed to send the qLaunchSuccess packet

   重新從appstore上下載安裝此軟件,再刪除,然後嘗試真機調試




Xcode 是蘋果公司的集成式開發環境(IDE),可以同時用來開發 iOS 和 Mac OS X 應用程序。當你在 Mac 電腦上安裝 Xcode 之後,同時也會安裝 iOS SDK,其中包含了 iOS 平臺開發所需的接口等。

   在線安裝下載地址 https://developer.apple.com/xcode/index.php

   下載地址 登錄進入 connect.apple.com,就可以看到下載列表


1. 編譯項目時常報如  Undefined symbols:
".objc_class_name_PlacardView", referenced from:
literal-pointer@__OBJC@__cls_refs@PlacardView in MoveMe2View.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

這樣的錯誤.

 

解決方法參考下文:

That has happened to me a lot of times. That error is caused when the compiler can't find a class or function. Besides the obvious reasons for that to happen, you should also do something like this:

On the left of the Xcode window go to the targets, and find your application. Open it. You should see a build phase named "Compile Sources". Make sure that your implementation file is included inside that build phase. If not, drag and drop it onto that build phase.

Also, make sure that you have all frameworks included and linked to your application! To make that sure, go into your application target again, and see the "Link Binary With Libraries" build phase. See if all necessary .framework files are in there. If not, add them using drag and drop.

 

在項目的Groups&Files窗口中,打開Targets/項目名 /Compile Sources/把提示找不到的源文件拖到這裏.重新編譯.

 

2.接上手機(版本 4.2.1 8c148a),在Organizer中,報The version of iOS  ...  does not match any of the versions of iOS supported...,重啓手機,xcode都不能解決。最後,重裝xcode_3.2.5_and_ios_sdk_4.2_final.dmg。

 

3.設置字體大小:

1)打開Preferences,快捷鍵是“Command +,”(注意,是三個鍵,按住command鍵,然後再快速地按“+”和“,”兩個鍵即可)

2)選擇“Fonts &Colors”,選中所有的“Category”,然後雙擊“Font”一列,在彈出的對話框中選擇適合自己的字體大小即可。


4.重構

包括重構變量名,方法名,和類名。

選擇變量名,點擊Edit\Refactor\Rename...,要在輸入框內輸入新名字後,點Preview,然後Preview變成Apply,點擊Apply。

http://blog.csdn.net/f520131480315/article/details/6457927


5.快照

    一般在開始重構之前要備份,選擇File-Make Snapshot,Xcode會記住項目當前的狀態。如果發現代碼被改得面目全非,選擇File-Snapshot,回到做快照的那一刻。

如果發現提示:Snapshot Failed:A project snapshot cannot be created. 可能是一個磁盤鏡像文件被損壞了,它用來存儲快照,可以到~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage 把鏡像文件刪掉,然後重啓xcode。

    如果發現修改了某些代碼之後出了問題,利用 Xcode 快照(snapshot)功能就可以輕鬆恢復工程到之前的狀態,甚至已刪除的工程也可以。快照會保存當前工程的所有狀態到磁盤上,以備之後進行恢復。Xcode 的工程管理器中列出了所有可用的快照。

    可以隨時手動創建快照,也可以讓 Xcode 根據場合自動創建快照,例如每次構建之前或通過查找並替換修改代碼之前等。

     File > Create Snapshot,輸入此快照的名稱和描述,點按 Create Snapshot。
此快照就會出現在工程管理器中了。要恢復到此快照,請點選 File > Restore Snapshot。


6.help\search

 用來查找在菜單中的功能,命令等。

 

7.在svn上增加目錄時,用import.

 

8. 修改某個文件時,彈出

This file is not writable. You could either perform an SCM Edit operation on this file, or allow editing anyway. You may not be able to save your changes, but you will be able to Save a Copy somewhere else.

是由於在本地鎖定了文件,顯示簡介 ,去掉勾選已鎖定。

 

9. 製表符替換成2個空格,在編寫程序代碼時用空格代替Tab,可以避免由於編輯器對tab顯示方式不同引起的代碼錯亂,是一種良好的編程風格

Xcode Preferences->Indentation 把indent width設置爲2個空格。


10.格式化代碼

    Edit - Format->Re-Indent

   在Xcode\Preferences...\ key bindings\拷貝一份xcode default\編輯Re-Indent 同時按下想要設置的快捷鍵。


   In Xcode 4, it's been moved to Editor (注意是Editor,不是Edit)> Structure > Re-Indent command (and has a default shortcut of CTRL+I ),默認快捷鍵是 Ctrl加i。它好按且未與其它快捷鍵衝突,所以不需要修改。


11.打不開工程文件時,打開project.pbxproj,查找衝突mine,刪除衝突標記。


12.換過證書,提示provising文件問題,在 project.pbxproj 中查找提示那串碼,刪除掉這串碼保存。

 

13.xcode 4.2 svn問題

    在Respotitories中選中工程目錄後,點update,彈出對話框,"Error validating server certificate for  googlecode.com:443.......",解決辦法:

    比如用瀏覽器登錄 http://code.google.com/p/.../source/checkout,複製 svn checkout https://xxx.googlecode.com/svn/trunk/ xxx --username xxx,到控制檯中運行,提示Error validating server certificate for 'https://xxx.googlecode.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: *.googlecode.com
 - Valid: from Wed, 11 Apr 2012 00:04:01 GMT until Thu, 11 Apr 2013 00:14:01 GMT
 - Issuer: Google Inc, US
 - Fingerprint: cb:f1:c8:ac:28:d5:61:b7:c1:9c:73:7e:3a:b6:bb:e2:e6:55:95:2a
(R)eject, accept (t)emporarily or accept (p)ermanently?  輸入p,開始checkout,然後到xcode中,發現也可以成功執行更新了。


  但在提交上,仍然彈出  Authentication realm: <https://xxx.googlecode.com:443> Google Code Subversion Repository
Password for '用戶名': 
Authentication realm: <https://xxx.googlecode.com:443> Google Code Subversion Repository
Username: svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/!svn/act/19511c13-1823-4c4e-a551-3e0dfd8c0510': authorization failed: Could not authenticate to server: rejected Basic challenge (https://xxx.googlecode.com)


14.在xcode4.2中,

      Product -> Profile 再選擇leaks,啓用內存泄漏監測。

      相比之下,Product \ Analyze 是更好的工具,它分析一些垃圾代碼,及潛在的內存泄漏,並且指出精確的代碼行。可以看出,它建議所有自定義函數都返回自動釋放的對象,否則會被列入潛在的內存泄漏中,potential leaks。

    添加framework,

  1. In the project navigator, selectyour project
  2. Select your target
  3. Select the 'Build Phases' tab
  4. Open 'Link Binaries With Libraries'expander
  5. Click the '+' button
  6. Select your framework
  7. (optional) Drag and drop the addedframework to the 'Frameworks' group

      且在xcode4中新建工程時,去掉Use storyboards,Use ARC,include Unit Tests三個複選。


15.  編譯可執行文件時,報object file format invalid or unsuitable

       打開終端:

       sudo su 

       查看/usr/bin目錄下是否存在codesign_allocate程序,如果存在,執行改名操作
       sudo mv /usr/bin/codesign_allocate /usr/bin/codesign_allocate_old

       將xcode目錄下的codesign做一個軟鏈接
       sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin


16. 真機調試時,提示 No provisioned IOS devices are available.Connect an IOS device or choose an IOS simulator as the destination.

      修改IOS Deployment Target,不要高於真機的版本。

http://rainbird.blog.51cto.com/211214/646828


17.添加預定義宏

    打開工程 Project--->Edit Project Editting(選着build)選項--->找到GCC Preprocessing->Preprocessor Macros ,例如設置其值爲DEBUG=1


18.xcode4中修改編譯生成文件的位置

   File\project settings\Derived data location\,選擇Project-relative,輸入文件夾名字


19. 真機調試報 error: failed to launch '/Users/gzty1/Library/Developer/Xcode/DerivedData/應用名-chiobhpmbvwnqudfqnfawdzjrtey/Build/Products/Debug-iphoneos/應用名.app/應用名' -- No such file or directory (/Users/gzty1/Library/Developer/Xcode/DerivedData/應用名-chiobhpmbvwnqudfqnfawdzjrtey/Build/Products/Debug-iphoneos/應用名.app/應用名)

     出現的原因可能是正在從appstore上安裝此程序,同時又在真機調試安裝些程序,導致後面真機調試安裝此程序一直失敗。

     解決方法:重新完成從appstore上安裝此程序後,再嘗試真機調試安裝。

 

20. Xcode 提供了一系列用來管理整個開發流程的工具,從創建應用到測試、優化應用,直至上傳應用到 App Store。

      http://www.guomii.com/posts/20273

      原英文版地址

      https://developer.apple.com/library/ios/#referencelibrary/GettingStarted/RoadMapiOS/Tools/CreateYourAppinXcode/StartYourProjectinXcode/StartYourProjectinXcode.html

      本《iOS應用開發入門指南》譯自蘋果官方的 Start Developing iOS Apps Today 系列教程。

      http://www.guomii.com/posts/20250


      Provisioning Portal 配置門戶

      在創建新工程嚮導中,Class Prefix,應用委託就會被命名爲 [Class Prefix]AppDelegate


21.Storyboards,故事板

     故事板裏包含了定義此應用程序用戶界面的對象、過渡(Transition)以及連接(Connection)。查看源文件發現MainStoryboard.storyboard是xml格式的內容。

     http://www.guomii.com/posts/20868

     利用 Xcode 檢視器(Inspector),來觀察視圖控制器的狀態等信息。

     需要注意的是,當選擇一個視圖時 Xcode 會將其高亮顯示,此時畫布中的顏色因爲疊加可能會和 Colors 窗口中所選的顏色不完全一致。

     對齊引導線,它們能幫你輕鬆在視圖中將 UI 元素對齊到邊界或中心位


22.IBActionOutlet

    在 Xcode 中,給某個 UI 元素添加動作並設定相應的動作方法的途徑是:按住 Control 鍵,並從畫布上的該元素拖動到合適的源文件上(一般而言就是視圖控制器的源文件)。故事板會把通過這種方式建立的連接進行存檔。之後,當應用運行載入故事板時,這些連接就會被還原出來。

   在 Xcode 工具條裏,點按 Utilities(實用工具)按鈕關閉實用工具區域,然後點按輔助編輯器按鈕(Assistant Editor)調出輔助編輯器面板。
確保輔助編輯器裏顯示的是視圖控制器的頭文件。在畫布中,按住 Control 並從 Hello 按鈕拖動到 HelloWorldViewController.h 的方法聲明部分(即 @interface 語句到 @end 語句之間的部分)。

   在非蘋果鍵盤上control鍵依然是Ctrl鍵。
   IBAction 是一個特殊的關鍵詞,用來告訴 Xcode 把一個方法當成目標-動作連接來看待。IBAction 被定義爲 void

   插座變量(Outlet)描述的是兩個對象之間的連接。當你需要讓一個對象(例如視圖控制器),與它所包含的一個對象(例如文本框)進行溝通時,你就會把被包含的那個對象稱爲插座變量。當應用運行起來時,你在 Xcode 裏創建的插座變量就被還原出來了,這樣在運行時這些對象就可以相互交流了。

   給文本框設置委託對象:按住 Control 鍵並從文本框拖動到場景塢裏的黃色球體上(黃色球體代表視圖控制器對象),當半透明面板出現時,選擇 Outlets(插座變量)部分的delegate


23.源代碼控制管理(SCM)

     能夠提供比快照更加細緻入微的變更跟蹤管理。(如果你在團隊中與他人協同工作,源代碼控制管理還能幫你提高團隊效率。)SCM 系統會在磁盤中對每個文件保存多個版本,並存儲各個文件各個版本的元數據到 SCM 倉庫中。

     Xcode 支持兩種流行的 SCM 系統:Git 和 Subversion。Xcode 包含了一個版本編輯器,無論使用哪種 SCM 系統都可以輕鬆對比保存在倉庫中文件的不同版本。如果你發現代碼中出現了漏洞,則可以將最新的版本和之前的某個正常運行的版本拿來比較,讓你捉出產生問題的“臭蟲”。




24.分發和發佈應用
     Xcode 能夠讓你輕鬆地將尚未正式發佈到 App Store 的應用分享給測試者們。要分發應用,請在方案編輯器中創建一個應用歸檔。然後就可以使用 Xcode 的歸檔管理器來讓測試者們分享你的應用。

     當你準備正式發佈應用的時候,可以先使用歸檔管理器來評估一下你的應用能否達到 App Store 審覈的標準。這項評估能夠通過則可以保障正式審覈過程儘可能地快速。然後就可以在 Xcode 正式向 App Store 提交你的應用了。


學習進度

http://www.guomii.com/posts/20284


25.在instruments中查看內存

    

The Living bytes, or Net bytes is how much memory your application is using at the time you select in the timeline. That will include leaked memory, since leaked memory is never deallocated.

#Living is how many allocations of a certain size/object type happened (and are still allocated). This is very useful when looking for leaks. For example, if you repetitively perform an action (like coming in an out of a modal view controller), and you see that #Living of an object grows by the same amount each time, then you're probably leaking those objects. You can then confirm by drilling down and seeing the exact line of code that is allocating the objects, and even see the time index each one was created.

Overall bytes includes memory that has been released. It's useful to track that number for performance optimization purposes, but not if you're just trying to see your current memory footprint or look for leaks.


筆畫輸入面板打開後,內存使用增加了20M


蘋果bug--獲取鍵盤有內存泄露問題
memory leaks in open_handle_to_dylib_path and UIKeyboardInputManagerClassForInputMode
If you're developing an iPhone app that uses UITextField objects and you're rigorous enough to check for memory leaks using Instruments, chances are you'd discover some leaks in UIKit and CoreGraphics libraries, stemming from some allocations done in dyld::mkstringf, called from dyld::loadPhase5.
According to some reports found on the web, it seems that this is a bug in the tools from Apple, and it appears only on the simulator, not when testing on the actual device. So you could safely ignore it. In any case you couldn't do anything about it, as the traceback leading to the leak goes through code outside of your control, that is, unless you happen to work for Apple :).


26.CodeSign error: code signing is required for product type Application in SDK iOS

在真機測試的時候往往會突然出現這樣一個錯誤,code signing is required for product type 'Application' in SDK 'iOS 8.1’  ,就是說代碼簽名證書不對勁。
解決方案:
1.選擇工程->Build Settings -> Code Signing -> Code Signing Identity -> Debug -> Any ios SDK 將選項改爲:iPhone Developer
2.重新下載你的證書,或者修改通配符,或者說修改你的appid 。選擇工程 -》Bundle Identifier  修改爲最新的appid 。造成這種原因是因爲你修改了你的app sdk版本。
如果還不行,可以試試
Edit Project Setting 下面的那個菜單:Edit Active Target “Hello World” =》Build =》 Code Signing =》 Any ios 的值設置爲iphone Developer


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章