QStringList IosDsymBuildStep::defaultCleanCmdList() const { IosRunConfiguration *runConf = qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration()); QTC_ASSERT(runConf, return QStringList(QLatin1String("echo"))); QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(QLatin1String(".dSYM")); return QStringList() << QLatin1String("rm") << QLatin1String("-rf") << dsymPath; }
bool IosDeployStep::init() { QTC_CHECK(m_transferStatus == NoTransfer); m_device = ProjectExplorer::DeviceKitInformation::device(target()->kit()); IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>( this->target()->activeRunConfiguration()); QTC_CHECK(runConfig); m_bundlePath = runConfig->bundleDir().toString(); if (m_device.isNull()) { emit addOutput(tr("Error: no device available, deploy failed."), BuildStep::ErrorMessageOutput); return false; } return true; }
QStringList IosDsymBuildStep::defaultCmdList() const { QString dsymutilCmd = "dsymutil"; Utils::FileName dsymUtilPath = IosConfigurations::developerPath() .appendPath("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil"); if (dsymUtilPath.exists()) dsymutilCmd = dsymUtilPath.toUserOutput(); IosRunConfiguration *runConf = qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration()); QTC_ASSERT(runConf, return QStringList("echo")); QString dsymPath = runConf->bundleDirectory().toUserOutput(); dsymPath.chop(4); dsymPath.append(".dSYM"); return QStringList({dsymutilCmd, "-o", dsymPath, runConf->localExecutable().toUserOutput()}); }
bool IosDeployStep::init(QList<const BuildStep *> &earlierSteps) { Q_UNUSED(earlierSteps); QTC_ASSERT(m_transferStatus == NoTransfer, return false); m_device = DeviceKitInformation::device(target()->kit()); IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>( this->target()->activeRunConfiguration()); QTC_ASSERT(runConfig, return false); m_bundlePath = runConfig->bundleDirectory().toString(); if (m_device.isNull()) { emit addOutput(tr("Error: no device available, deploy failed."), BuildStep::ErrorMessageOutput); return false; } return true; }
RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, ProjectExplorer::RunMode mode, QString *errorMessage) { Q_ASSERT(canRun(runConfig, mode)); IosRunConfiguration *rc = qobject_cast<IosRunConfiguration *>(runConfig); Q_ASSERT(rc); RunControl *res = 0; Core::Id devId = ProjectExplorer::DeviceKitInformation::deviceId(rc->target()->kit()); // The device can only run an application at a time, if an app is running stop it. if (m_activeRunControls.contains(devId)) { if (QPointer<ProjectExplorer::RunControl> activeRunControl = m_activeRunControls[devId]) activeRunControl->stop(); m_activeRunControls.remove(devId); } if (mode == NormalRunMode) res = new Ios::Internal::IosRunControl(rc); else res = IosDebugSupport::createDebugRunControl(rc, errorMessage); if (devId.isValid()) m_activeRunControls[devId] = res; return res; }
RunControl *IosRunControlFactory::create(RunConfiguration *runConfig, Core::Id mode, QString *errorMessage) { Q_ASSERT(canRun(runConfig, mode)); IosRunConfiguration *rc = qobject_cast<IosRunConfiguration *>(runConfig); Q_ASSERT(rc); Target *target = runConfig->target(); QTC_ASSERT(target, return 0); RunControl *res = 0; Core::Id devId = DeviceKitInformation::deviceId(rc->target()->kit()); // The device can only run an application at a time, if an app is running stop it. if (m_activeRunControls.contains(devId)) { if (QPointer<RunControl> activeRunControl = m_activeRunControls[devId]) activeRunControl->stop(); m_activeRunControls.remove(devId); } if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) res = new Ios::Internal::IosRunControl(rc); else if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) { AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(runConfig, mode); QTC_ASSERT(runControl, return 0); IDevice::ConstPtr device = DeviceKitInformation::device(target->kit()); if (device.isNull()) return 0; auto iosRunConfig = qobject_cast<IosRunConfiguration *>(runConfig); StandardRunnable runnable; runnable.executable = iosRunConfig->localExecutable().toUserOutput(); runnable.commandLineArguments = iosRunConfig->commandLineArguments(); AnalyzerConnection connection; connection.analyzerHost = QLatin1String("localhost"); runControl->setRunnable(runnable); runControl->setConnection(connection); runControl->setDisplayName(iosRunConfig->applicationName()); (void) new IosAnalyzeSupport(iosRunConfig, runControl, false, true); return runControl; }
QString IosDeployStep::appBundle() const { IosRunConfiguration * runConfig = qobject_cast<IosRunConfiguration *>( this->target()->activeRunConfiguration()); return runConfig->bundleDir().toString(); }