Android virtual devices: Fix starting a avd

This cleans up various bits of the avd support in Creator.
- Adds a abi combobox to the create avd dialog.
- Moves the startAvd code into a separate thread, so that
  starting a avd while deploying doesn't block creator anymore.
- Implements a better waitForAvd function that works even
  if a emulator is already running and accurately can
  detect that it has finished booting.

Note: There are still many problems in the avd support in creator.
- The "clean libs on device" and "install qasi" functionality block
  the gui thread if they are run on a avd.
- If no avd exists and no suitable hardware is attached, the user gets
  a create Avd dialog, which doesn't tell him why he needs to create a
  avd. That information is hidden in the compile output.

Still this fixes the main use case of hitting run on a newly created
project with no actual device attached.

Change-Id: I76b3fdb1bdf3eadac07f82ad7d145ce6af453326
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
Daniel Teske
2013-07-05 18:54:42 +02:00
parent 14d05eade8
commit 480f7c09fc
6 changed files with 168 additions and 93 deletions

View File

@@ -93,11 +93,15 @@ public:
Utils::FileName stripPath(ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolChainVersion) const;
Utils::FileName readelfPath(ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolChainVersion) const;
QString getDeployDeviceSerialNumber(int *apiLevel, const QString &abi, QString *error = 0) const;
bool createAVD(const QString &target, const QString &name, int sdcardSize) const;
QString createAVD(int minApiLevel = 0, QString targetArch = QString()) const;
QString createAVD(const QString &target, const QString &name, const QString &abi, int sdcardSize) const;
bool removeAVD(const QString &name) const;
QVector<AndroidDeviceInfo> connectedDevices(QString *error = 0) const;
QVector<AndroidDeviceInfo> androidVirtualDevices() const;
QString startAVD(int *apiLevel, const QString &name = QString()) const;
QString findAvd(int *apiLevel, const QString &cpuAbi);
QString startAVD(const QString &name, int apiLevel, QString cpuAbi) const;
bool startAVDAsync(const QString &avdName) const;
QString waitForAvd(int apiLevel, const QString &cpuAbi) const;
QString bestMatch(const QString &targetAPI) const;
QStringList makeExtraSearchDirectories() const;
@@ -110,12 +114,12 @@ public:
void updateAndroidDevice();
QString getProductModel(const QString &device) const;
bool hasFinishedBooting(const QString &device) const;
signals:
void updated();
public slots:
bool createAVD(int minApiLevel = 0) const;
void updateAutomaticKitList();
private: