解决error: failed to launch"/private/var/mobile/Applications/XX"-- timed out waiting for app to launch
今天做ios遇见这个问题,网上也没有明确的说明啥原因,最后发现是自己免证书的项目配置出错了,最后重新配置了一下项目的Run Script就可以了,具体步骤如下:
1.选中项目后,点击Build Phases,在右下方看见Add Build Phase
2.选择Add Build Phase ,然后选择Run Script ,再在shell下的输入框中添加一下内容:
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
以上代码不能缺少,然后保存
操作完成后,重运行项目就ok了,这个操作只是针对xcode4.3 xcode4.4 ios版本位5.1.1的版本,越狱手机和免证书的xcode环境