[xcode]Error launching remote program: failed to get the task for process xxx 本人解決辦法

參考貼:http://kqwd.blog.163.com/blog/static/4122344820117191351263/

真機測試的時候,出現以上的錯誤,翻了很多貼,發現了一個貼說是,製作證書沒做好,我只好重新看一遍,我的做法是兩步。

第一步:TARGETS -> Build Phases -> Add Build Phase -> Add Run Script

如下圖




接着在這裏


添加以下腳本:

export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ] || [ "${PLATFORM_NAME}" == "ipados" ]; then
/Applications/Xcode.app/Contents/Developer/iphoneentitlements/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
fi



第二步: TARGETS -> Build Setting -> Code Signing -> Code Signing Identity 改成 Don't Code Sign






這兩步完成就真機測試一下,問題都解決了,而且可以實現真機單步運行。


如果另外一個工程真機測試有出現以上錯誤,就重複做該兩步。

發佈了140 篇原創文章 · 獲贊 10 · 訪問量 24萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章