@zsukim/ctv-run 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -39,8 +39,18 @@
39
39
  "ip": "192.168.x.x",
40
40
  "url": "http://192.168.x.x:3300"
41
41
  },
42
+ "fire": {
43
+ "ip": "192.168.x.x",
44
+ "android": {
45
+ "package": "com.example.app",
46
+ "projectPath": "/path/to/android-project"
47
+ }
48
+ },
42
49
  "tizen": {
43
50
  "ip": "192.168.x.x"
51
+ },
52
+ "webos": {
53
+ "deviceName": "my-lg-tv"
44
54
  }
45
55
  }
46
56
  ```
@@ -60,13 +70,13 @@
60
70
  | Field | 필수 | Description |
61
71
  |-------|------|-------------|
62
72
  | `ip` | ✅ | TV 로컬 IP |
63
- | `package` | ✅ | Android 앱 패키지명 |
64
73
  | `url` | | TV가 로드할 URL |
65
74
  | `port` | | TV가 로드할 URL의 포트 |
66
- | `activity` | | 실행할 Activity (기본값: `.MainActivity`) |
67
- | `adbPath` | | adb 실행 경로 (기본값: `adb`) |
68
- | `androidProjectPath` | Static Mode 시 ✅ | Android 프로젝트 루트 경로 (gradlew가 있는 폴더) |
69
- | `moduleName` | | Android 모듈명 (기본값: `app`) |
75
+ | `android.package` | | Android 패키지명 |
76
+ | `android.activity` | | 실행할 Activity (기본값: `.MainActivity`) |
77
+ | `android.projectPath` | Static Mode 시 ✅ | Android 프로젝트 루트 경로 (gradlew가 있는 폴더) |
78
+ | `android.moduleName` | | Android 모듈명 (기본값: `app`) |
79
+ | `android.adbPath` | | adb 실행 경로 (기본값: `adb`) |
70
80
 
71
81
  **Tizen**
72
82
 
@@ -21,21 +21,21 @@ const ip_1 = require("../utils/ip");
21
21
  const platform_1 = require("../utils/platform");
22
22
  function runFireTv() {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
24
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
25
25
  const args = process.argv.slice(2);
26
26
  const config = (0, config_1.loadConfig)();
27
27
  const getArg = (0, platform_1.makeArgParser)(args);
28
28
  // 설정 및 인자 파싱
29
- const adbBin = getArg('adbPath') || ((_a = config.fire) === null || _a === void 0 ? void 0 : _a.adbPath) || 'adb';
30
- const tvIp = getArg('ip') || ((_b = config.fire) === null || _b === void 0 ? void 0 : _b.ip);
31
- const pkg = getArg('package') || ((_c = config.fire) === null || _c === void 0 ? void 0 : _c.package);
32
- const activity = getArg('activity') || ((_d = config.fire) === null || _d === void 0 ? void 0 : _d.activity) || '.MainActivity';
29
+ const adbBin = getArg('adbPath') || ((_b = (_a = config.fire) === null || _a === void 0 ? void 0 : _a.android) === null || _b === void 0 ? void 0 : _b.adbPath) || 'adb';
30
+ const tvIp = getArg('ip') || ((_c = config.fire) === null || _c === void 0 ? void 0 : _c.ip);
31
+ const pkg = getArg('package') || ((_e = (_d = config.fire) === null || _d === void 0 ? void 0 : _d.android) === null || _e === void 0 ? void 0 : _e.package);
32
+ const activity = getArg('activity') || ((_g = (_f = config.fire) === null || _f === void 0 ? void 0 : _f.android) === null || _g === void 0 ? void 0 : _g.activity) || '.MainActivity';
33
33
  const targetArg = getArg('target');
34
- const androidProjectPath = getArg('androidProjectPath') || ((_e = config.fire) === null || _e === void 0 ? void 0 : _e.androidProjectPath);
35
- const moduleName = getArg('moduleName') || ((_f = config.fire) === null || _f === void 0 ? void 0 : _f.moduleName) || 'app';
34
+ const androidProjectPath = getArg('androidProjectPath') || ((_j = (_h = config.fire) === null || _h === void 0 ? void 0 : _h.android) === null || _j === void 0 ? void 0 : _j.projectPath);
35
+ const moduleName = getArg('moduleName') || ((_l = (_k = config.fire) === null || _k === void 0 ? void 0 : _k.android) === null || _l === void 0 ? void 0 : _l.moduleName) || 'app';
36
36
  // 앱 URL 결정 (Live Mode 전용)
37
- const userUrl = getArg('url') || ((_g = config.fire) === null || _g === void 0 ? void 0 : _g.url);
38
- const port = getArg('port') || ((_h = config.fire) === null || _h === void 0 ? void 0 : _h.port) || ((_j = config.common) === null || _j === void 0 ? void 0 : _j.devServerPort) || 3000;
37
+ const userUrl = getArg('url') || ((_m = config.fire) === null || _m === void 0 ? void 0 : _m.url);
38
+ const port = getArg('port') || ((_o = config.fire) === null || _o === void 0 ? void 0 : _o.port) || ((_p = config.common) === null || _p === void 0 ? void 0 : _p.devServerPort) || 3000;
39
39
  const appUrl = userUrl || `http://${(0, ip_1.getLocalIp)()}:${port}`;
40
40
  if (!tvIp || !pkg) {
41
41
  console.error(`\n❌ Fire TV 필수 설정(ip, package)이 누락되었습니다!`);
@@ -103,6 +103,15 @@ function runFireTv() {
103
103
  // ADB 연결
104
104
  console.log(`🔗 ADB Connecting to ${tvIp}...`);
105
105
  (0, child_process_1.execSync)(`${adbBin} connect ${tvIp}:5555`, { stdio: 'pipe' });
106
+ // 앱 설치 여부 확인 (Live Mode 전용)
107
+ if (!targetArg) {
108
+ const installed = (0, child_process_1.execSync)(`${adbBin} -s ${tvIp}:5555 shell pm list packages ${pkg}`, { encoding: 'utf8' }).includes(pkg);
109
+ if (!installed) {
110
+ console.error(`\n❌ 앱이 설치되어 있지 않습니다. (${pkg})`);
111
+ console.error(` 처음 설치는 --target=dist 로 먼저 실행해주세요.`);
112
+ return;
113
+ }
114
+ }
106
115
  // 기존 앱 종료
107
116
  console.log('🔄 Force stopping existing process...');
108
117
  (0, child_process_1.execSync)(`${adbBin} -s ${tvIp}:5555 shell am force-stop ${pkg}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsukim/ctv-run",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Smart TV deployment CLI for Vizio, LG webOS, Fire TV, and Samsung Tizen",
5
5
  "keywords": [
6
6
  "ctv",