@aiot-toolkit/emulator 2.0.2-beta.1 → 2.0.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/avd/index.js CHANGED
@@ -8,6 +8,7 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const constants_1 = require("../static/constants");
10
10
  const Avd_1 = require("../typing/Avd");
11
+ const os_1 = __importDefault(require("os"));
11
12
  const EAvdParamsToIni = {
12
13
  'arm': {
13
14
  abiType: 'armeabi-v7a',
@@ -26,6 +27,12 @@ class VelaAvdCls {
26
27
  }
27
28
  }
28
29
  createVelaAvd(avdParams) {
30
+ // 在.android下创建advancedFeatures.ini文件
31
+ const advancedFeaturesIni = path_1.default.resolve(os_1.default.homedir(), '.android/advancedFeatures.ini');
32
+ if (!fs_1.default.existsSync(advancedFeaturesIni)) {
33
+ const iniSourcePath = path_1.default.join(__dirname, '../static/advancedFeatures.ini');
34
+ fs_1.default.copyFileSync(iniSourcePath, advancedFeaturesIni);
35
+ }
29
36
  const { avdName, avdArch, avdWidth, avdHeight, avdSkin, avdImagePath = constants_1.defaultImageHome } = avdParams;
30
37
  const avdDir = path_1.default.resolve(this.avdHome, `${avdName}.avd`);
31
38
  const avdIni = path_1.default.resolve(this.avdHome, `${avdName}.ini`);
@@ -104,10 +104,13 @@ class MiwearInstance extends common_1.default {
104
104
  // 文件系统配置,第一次使用fatfs镜像挂载,后续使用adb push更新应用
105
105
  const systemImageBin = path_1.default.resolve(avdImagePath, 'vela_resource.img');
106
106
  const dataImageBin = path_1.default.resolve(avdImagePath, 'data.img');
107
+ const coreBin = path_1.default.resolve(avdImagePath, 'coredump.core');
107
108
  const imageMountStr = `-drive index=0,id=system,if=none,format=raw,file=${systemImageBin} \
108
109
  -device virtio-blk-device,bus=virtio-mmio-bus.0,drive=system \
109
110
  -drive index=1,id=userdata,if=none,format=raw,file=${dataImageBin} \
110
111
  -device virtio-blk-device,bus=virtio-mmio-bus.1,drive=userdata \
112
+ -drive index=2,id=vendor,if=none,format=raw,file=${coreBin} \
113
+ -device virtio-blk-device,bus=virtio-mmio-bus.4,drive=vendor \
111
114
  -device virtio-snd,bus=virtio-mmio-bus.2 -allow-host-audio -semihosting`;
112
115
  // vnc配置
113
116
  let windowStr = '';
@@ -125,7 +128,7 @@ class MiwearInstance extends common_1.default {
125
128
  ColorConsole_1.default.log(`### Emulator ### Start CMD: ${cmd}`);
126
129
  return new Promise((resolve) => {
127
130
  var _a, _b, _c;
128
- this.goldfishProcess = (0, child_process_1.spawn)(spawnBin, spawnArgs, { stdio: stdioType, shell: true });
131
+ this.goldfishProcess = (0, child_process_1.spawn)(spawnBin, spawnArgs, { stdio: stdioType, shell: true, cwd: this.sdkHome });
129
132
  (_a = this.goldfishProcess.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
130
133
  const stderrCb = options.stderrCallback || console.log;
131
134
  stderrCb(data.toString());
@@ -0,0 +1 @@
1
+ ModemSimulator = on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiot-toolkit/emulator",
3
- "version": "2.0.2-beta.1",
3
+ "version": "2.0.2-beta.2",
4
4
  "description": "vela emulator tool.",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -35,10 +35,10 @@
35
35
  "emulator"
36
36
  ],
37
37
  "dependencies": {
38
- "@aiot-toolkit/aiotpack": "2.0.2-beta.1",
39
- "@aiot-toolkit/shared-utils": "2.0.2-beta.1",
38
+ "@aiot-toolkit/aiotpack": "2.0.2-beta.2",
39
+ "@aiot-toolkit/shared-utils": "2.0.2-beta.2",
40
40
  "find-process": "^1.4.7",
41
41
  "portfinder": "^1.0.32"
42
42
  },
43
- "gitHead": "9244af36e617295ea4ff11a2f4f07f0e4f9f5f59"
43
+ "gitHead": "5226bdb0ba61daef207531c2eaaf3d034e04c50f"
44
44
  }