diff --git a/packages/app-harness/appConfigs/harness/renative.json b/packages/app-harness/appConfigs/harness/renative.json index 3f3989ab9..c65a87c92 100644 --- a/packages/app-harness/appConfigs/harness/renative.json +++ b/packages/app-harness/appConfigs/harness/renative.json @@ -95,8 +95,8 @@ } }, "tizen": { - "package": "NkVRhWHJST", - "id": "NkVRhWHJST.RNVanillaTV" + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV" }, "tizenwatch": { "package": "cHIP2fIRQZ", diff --git a/packages/sdk-tizen/src/deviceManager.ts b/packages/sdk-tizen/src/deviceManager.ts index 7c879e382..c4c3f72a5 100644 --- a/packages/sdk-tizen/src/deviceManager.ts +++ b/packages/sdk-tizen/src/deviceManager.ts @@ -81,11 +81,14 @@ export const launchTizenEmulator = async (name: string | true): Promise const devices_lines = devices.split('\n'); const allDownloadedEmulators = emulators.split('\n'); // all tizen, tizenwatch and tizenmobile emulators + const specificEmulators = await getSubplatformDevices(allDownloadedEmulators, c.platform as string); + const devicesArr = devices_lines.slice(1).map((line: string) => line.split(' ')[0]); // devices array with only their ip - const lines = specificEmulators.concat(devices_lines.slice(1)); + const lines = specificEmulators.concat(devicesArr); const targetsArray = lines.map((line) => ({ id: line, name: line })); + const choices = _composeDevicesString(targetsArray); const { chosenEmulator } = await inquirerPrompt({ @@ -99,6 +102,14 @@ export const launchTizenEmulator = async (name: string | true): Promise } if (name) { + const ipRegex = /^(?:\d{1,3}\.){3}\d{1,3}:\d{1,5}$/; + if (name !== true && ipRegex.test(name)) { + // if ip is chosen, real device boot should start + logInfo('Connecting to device'); + c.runtime.target = name.split(':')[0]; + await runTizenSimOrDevice(); + return true; + } try { await executeAsync( `${c.cli[CLI_TIZEN_EMULATOR]} launch --name ${name}`, @@ -163,7 +174,12 @@ const getSubplatformDevices = async (allTizenEmulators: string[], neededPlatform export const listTizenTargets = async (platform: string) => { const emulatorsString = await execCLI(CLI_TIZEN_EMULATOR, 'list-vm'); const devicesString = await execCLI(CLI_SDB_TIZEN, 'devices'); - const devicesArr = devicesString.split('\n').slice(1); + const devicesArr = devicesString + .split('\n') + .slice(1) + .map((line: string) => line.split(' ')[0]); + // turns devices string: ' List of devices attached \n192.168.0.105:26101 device UE43NU7192' to only the '192.168.0.105:26101' + const allDownloadedEmulators = emulatorsString.split('\n'); // all tizen, tizenwatch and tizenmobile emulators const specificPlatformEmulators = await getSubplatformDevices(allDownloadedEmulators.concat(devicesArr), platform); // tizen, tizenwatch, tizenmobile - only 1 of them let targetStr = ''; @@ -415,7 +431,9 @@ Please create one and then edit the default target from ${c.paths.workspace.dir} try { const packageID = platform === 'tizenwatch' || platform === 'tizenmobile' ? tId.split('.')[0] : tId; - await execCLI(CLI_TIZEN, `uninstall -p ${packageID} -t ${deviceID}`, { ignoreErrors: true }); + await execCLI(CLI_TIZEN, `uninstall -p ${packageID} -t ${deviceID}`, { + ignoreErrors: true, + }); hasDevice = true; } catch (e) { if (typeof e === 'string' && e.includes('No device matching')) { diff --git a/packages/template-starter/appConfigs/base/renative.json b/packages/template-starter/appConfigs/base/renative.json index 93c1844ea..8102adbc3 100644 --- a/packages/template-starter/appConfigs/base/renative.json +++ b/packages/template-starter/appConfigs/base/renative.json @@ -210,8 +210,8 @@ "appName": "RNVanillaTV", "entryFile": "index", "certificateProfile": "RNVanillaCert", - "package": "NkVRhWHJST", - "id": "NkVRhWHJST.RNVanillaTV", + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV", "buildSchemes": { "debug": { "bundleAssets": false diff --git a/packages/template-starter/appConfigs/template/renative.json b/packages/template-starter/appConfigs/template/renative.json index 8ae9588d1..26b6b890c 100644 --- a/packages/template-starter/appConfigs/template/renative.json +++ b/packages/template-starter/appConfigs/template/renative.json @@ -84,8 +84,8 @@ } }, "tizen": { - "package": "NkVRhWHJST", - "id": "NkVRhWHJST.RNVanillaTV" + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV" }, "tizenwatch": { "package": "cHIP2fIRQZ",