weex run ios 不成功问题

在目前weex1.2.9版本中,通过weex run ios 运行iOS模拟器的时候失败,报错:

Error:Error: Command failed: xcodebuild -workspace WeexDemo.xcworkspace -scheme WeexDemo -configuration Debug -destination id=15CCC22B-5292-4708-B32B-BA5FB842CFFC -sdk iphonesimulator -derivedDataPath build clean build
2018-03-07 14:24:12.241 xcodebuild[1676:253626]  iPhoneConnect: ## Unable to mount developer disk image, (Error Domain=com.apple.dtdevicekit Code=-402652958 "Development cannot be enabledwhile your device is locked." UserInfo={NSLocalizedDescription=Development cannot be enabled while your device is locked., com.apple.dtdevicekit.stacktrace=(
        0   DTDeviceKitBase                     0x0000000110088fed DTDKCreateNSError + 113
        1   DTDeviceKitBase                     0x0000000110089831 DTDK_AMDErrorToNSError + 1135
        2   DTDeviceKitBase                     0x00000001100ca441 -[DTDKMobileDeviceToken mountDeveloperDiskImage:withError:] + 782
        3   DTDeviceKitBase                     0x00000001100cacf8 -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 488
        4   IDEiOSSupportCore                   0x000000010ffae250 __37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 133
        5   DVTFoundation                       0x0000000104ee2b63 __DVTDispatchGroupAsync_block_invoke + 806
        6   libdispatch.dylib                   0x00007fff6a73c591 _dispatch_call_block_and_release + 12
        7   libdispatch.dylib                   0x00007fff6a734d50 _dispatch_client_callout +8
        8   libdispatch.dylib                   0x00007fff6a747ef5 _dispatch_continuation_pop+ 599
        9   libdispatch.dylib                   0x00007fff6a73f6cb _dispatch_async_redirect_invoke + 703
        10  libdispatch.dylib                   0x00007fff6a736941 _dispatch_root_queue_drain+ 515
        11  libdispatch.dylib                   0x00007fff6a7366ed _dispatch_worker_thread3 +101
        12  libsystem_pthread.dylib             0x00007fff6a9f91ca _pthread_wqthread + 1387
        13  libsystem_pthread.dylib             0x00007fff6a9f8c4d start_wqthread + 13
), NSLocalizedRecoverySuggestion=Please unlock your device and reattach. (0xE80000E2)., NSLocalizedFailureReason=Please unlock your device and reattach. (0xE80000E2).}) {
    NSLocalizedDescription = "Development cannot be enabled while your device is locked.";
    NSLocalizedFailureReason = "Please unlock your device and reattach. (0xE80000E2).";
    NSLocalizedRecoverySuggestion = "Please unlock your device and reattach. (0xE80000E2).";
    "com.apple.dtdevicekit.stacktrace" = (
        0   DTDeviceKitBase                     0x0000000110088fed DTDKCreateNSError + 113
        1   DTDeviceKitBase                     0x0000000110089831 DTDK_AMDErrorToNSError + 1135
        2   DTDeviceKitBase                     0x00000001100ca441 -[DTDKMobileDeviceToken mountDeveloperDiskImage:withError:] + 782
        3   DTDeviceKitBase                     0x00000001100cacf8 -[DTDKMobileDeviceToken mountDeveloperDiskImageWithError:] + 488
        4   IDEiOSSupportCore                   0x000000010ffae250 __37-[DVTiOSDevice(Connect) hasConnected]_block_invoke_2 + 133
        5   DVTFoundation                       0x0000000104ee2b63 __DVTDispatchGroupAsync_block_invoke + 806
        6   libdispatch.dylib                   0x00007fff6a73c591 _dispatch_call_block_and_release + 12
        7   libdispatch.dylib                   0x00007fff6a734d50 _dispatch_client_callout +8
        8   libdispatch.dylib                   0x00007fff6a747ef5 _dispatch_continuation_pop+ 599
        9   libdispatch.dylib                   0x00007fff6a73f6cb _dispatch_async_redirect_invoke + 703
        10  libdispatch.dylib                   0x00007fff6a736941 _dispatch_root_queue_drain+ 515
        11  libdispatch.dylib                   0x00007fff6a7366ed _dispatch_worker_thread3 +101
        12  libsystem_pthread.dylib             0x00007fff6a9f91ca _pthread_wqthread + 1387
        13  libsystem_pthread.dylib             0x00007fff6a9f8c4d start_wqthread + 13
);
}
** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution [CP]\ Check\ Pods\ Manifest.lock build/Build/Intermediates.noindex/WeexDemo.build/Debug-iphonesimulator/WeexDemo.build/Script-CD3187D7C603AFBFADBBAE7F.sh
(1 failure)

    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at _buildOnSimulator (/Users/Codeliu/.xtoolkit/node_modules/weexpack/lib/run/ios.js:328:18)
    at /Users/Codeliu/.xtoolkit/node_modules/weexpack/lib/run/ios.js:300:7
    at new Promise ()
    at buildApp (/Users/Codeliu/.xtoolkit/node_modules/weexpack/lib/run/ios.js:289:10)
    at 
    at process._tickCallback (internal/process/next_tick.js:188:7)

刚碰到这个问题觉得weex坑死了,运行不成功,很麻烦,重新运行都特别麻烦,主要是看到红色的错误,有点急躁。后来找到了解决办法,处理方法在Xcode中。
打开Xcode->target->Build Phases 删除[CP] Check Pods Manifest.lock,之后,在项目中运行weex run ios 就可以正常运行了,原因是pod本身的一种保护机制,防止配置被改写。#300

你可能感兴趣的:(Weex学习,带你走进weex)