1. 程式人生 > >【iOS】真機除錯問題總結 錯誤集合

【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:
[email protected][email protected][email protected] 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

      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

相關推薦

iOS除錯問題總結 錯誤集合

該文章轉載於CSDN某俠客,純屬學習,原文連結:http://blog.csdn.net/luyuncsd123/article/details/25028803 1. 編譯iPad真機時,選擇了 Architetures:Standard(armv6) BaseSD

iOS測試及佈署Code Sign error問題總結

除此之外可能的情況: Code Sign error: Certificate identity 'iPhone Developer: idf (XR9HN3TD7E)' appears more than once in the keychain. The code

除錯問題 錯誤集合

1. 編譯iPad真機時,選擇了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad. 若編譯出現如下錯誤: Command /Developer/Platforms

iOS 12 除錯 Xcode 9 提示 Could not locate device support files.

升級 iOS 12 之後,使用 Xcode 9 真機除錯會提示錯誤: Could not locate device support files. This iPhone 6 Plus is running iOS 12.0 (16A366), which may not be supported b

Unity如何不使用開發者賬號進行IOS除錯

好久沒有寫部落格了,一個字 懶。。。 最近研究了下IOS的打包,發展現在已經可以在不使用開發者賬號的情況下進行真機除錯了! 曾幾何時,IOS的測試是那些沒有賬號的開發者的一大難題~廢話不多說,開搞 首先,要進行蘋果的打包與測試,我們首先需要準備一些東西:Mac電腦一臺,或者

ios xcode除錯獲取螢幕截圖

很多時候我們需要在除錯的過程中把手機螢幕截圖發給其他人看,在android開發中我們可以很方便的截圖儲存,而xcode開發ios的時候發現這個需求卻如此困難,網上大部分都是介紹的下面這樣的方法,但是我在xcode 6.

iOS---新增除錯證書

前提是已經申請了iOS開發者賬號。 一、生成證書籤名公鑰(CertificateSigningRequest.certSigningRequest) 1、點選桌面-前往-實用工具-雙擊“鑰匙串訪問”

ios開發 除錯訪問本地伺服器的url問題

在ios開發的過程中,如果我們在本地部署了Tomcat,就可以利用http://localhost:8080在虛擬機器中訪問本地的伺服器。但是如果我們要用真機進行除錯,利用這個就行不通了。 解決辦法: 讓電腦和手機連線同一個wifi,這樣手機跟電腦就連線在同一個區域網上了。

開發工具iOS除錯抓包工具Charles安裝及使用

支援原創,更多內容請關注: iOS開發過程中,經常需要用真機來測試和後臺的網路資料傳輸,需要一個趁手的抓包工具。在Windows下用的fidder很好用,但是由於它是在.Net框架之下的,所以在Mac下需要有一個替代品,就是Charles。 一、安裝 二、

IOS學習之常見問題 Xcode除錯時常遇到的問題

1. A build only device cannot be used to run this targe 這個是在編輯執行時,沒有選擇真機或者模擬器導致的,而選擇Generic iOS Device通常是打包的時候才選擇這個。切換方式如下:

IOS學習之工具學習 Xcode7 / Xcode8 模擬器除錯除錯

作為一名開發者,無論寫多麼好的程式碼,多麼沒有bug的程式碼,最終都要進行的一步,就是 除錯,正常剛開始是模擬器除錯,最後在真機除錯,都除錯ok後,再給測試人員 進行不同 機型 的除錯 以及測試app在不同ios系統下的相容性。ios剛研究兩週,目前 瞭解了 模

iOS開發-32iOS程序調試須要購買調試證書怎麽辦?

pos 上進 ack tracking popu 怎麽辦 ont 調試 開發程序 一、情況 我們在開發iOS程序的時候,一般都是在模擬器上執行查看效果的。可是,當開完完畢。須要在真機上調試怎麽辦? 二、官方解決的方法 蘋果有為個人和企業開發人員提供調試證書和

React-Nativewindows環境下Android除錯指南

推薦使用IntelliJ IDEA作為react-native專案的IDE,它兼有Android Studio和WebStorm的功能,也就是既支援安卓開發同時也支援web開發(包括react的jsx語法),且除錯起來相當方便。 準備工作 下載安卓SDK。 安裝

Android效能優化HierarchyViewer無法連線除錯

之前用HierarchyViewer檢視應用的UI資訊,感覺很給力,但是今天刷了使用者版的韌體後,用hierarchyViewer就不可以,出現下面的錯誤: hierarchyviewer unable to debug device To preserve security, Hierarchy Vi

iOS 除錯、打包測試、釋出程式常見問題

原文地址::https://blog.csdn.net/shihuboke/article/details/73864246   相關文章 1、iOS 建立真機除錯證書流程----https://blog.csdn.net/shihuboke/article/details/7

IOS開發之免費證書+不越獄除錯

蘋果釋出Xcode7後, 開放了普通的AppleID也能真機除錯,非$99 或 $299, 只要能上AppStore下載應用的AppleID就行了。關於Mac系統及Xcode的安裝如果不會請參照原文描述,這裡只介紹利用Xcode7和普通AppID生成免費證書、Profil

微信小程式除錯錯誤:setStorageSync:fail Error: Failed To Send Sync

今天真是被這個坑搞得腦虧疼,本來想再storage裡快取下openId和token,但是不管用自己封裝的方法還是微信原生的wx.setStorage方法報錯: setStorageSync:fail Error: Failed To Send Sync  找了很多

Xcode7 2如何除錯iOS 9 3的裝置

                       大熊貓豬·侯佩原創或翻譯作品.歡迎轉載,轉載請註明出處.   如果覺得寫的不好請多提意見,如果覺得不錯請多多支援點贊.謝謝! hopy ;)本貓的mac系統為10.10,Xcode版本為7.2本貓將iPhone6p系統升級成了9.3,但是支援iOS9.3的Xcod

iOSNSMutableArray遍歷刪除內部元素的問題總結

NSMutableArray使用的範圍非常廣,一般在專案中獲取資料後放進NSMutableArray中,或者在一些新增新物件或者插入資料的時候也會經常用到。 我們經常遇到的一個需求是,遍歷一個數組,將數組裡面的元素遍歷,刪除掉不符合規則的資料。這裡面就有幾點非

快速解決低版本Xcode不支援高版本的iOS除錯問題

剛升級的iOS11.0,Xcode執行出現這個錯誤: This iPhone 6s Plus is running iOS 11.0 (15A5278f), which may not be sup