Simulator: major issue for testing Intent if jungles are used in target app

  • A Descriptive Title:
    • Simulator does not consider jungles of the target app when System.exitTo() is used to open it


  • The Environment:
    • CIQ SDK 3.0.8


  • A detailed description of the issue
    • Simulator does not consider jungles of the target app when System.exitTo() is used to open it. So things like "excludeAnnotations" are not correctly handled.


  • Steps to reproduce the issue
    • Create two new projects: an app which will be the caller (IntentBug_Caller) and an app which will be the target (IntentBug_Target).
    • Both apps should support ONLY the Fenix 5, the Vivoactive 3 and the Vivoactive HR
    • Modify the files as indicated below.
    • Run the apps separately on any of these devices and you will understand the issue. (run the target app first, so it gets installed)


  • A code sample that can reproduce the issue:

monkey.jungle (of the target)

project.manifest = manifest.xml

vivoactive_hr.excludeAnnotations = i_am_a_fenix5;i_am_a_vivoactive3
vivoactive3.excludeAnnotations = i_am_a_vivoactive_hr;i_am_a_fenix5
fenix5.excludeAnnotations = i_am_a_vivoactive_hr;i_am_a_vivoactive3






IntentBug_TargetView.mc

using Toybox.WatchUi;
using Toybox.Graphics as Gfx;

class IntentBug_TargetView extends WatchUi.View {

function initialize() {
View.initialize();
}
function onLayout(dc){}
function onShow(){}
function onHide(){}


function onUpdate(dc) {
View.onUpdate(dc);

var whichCodesDoIHave = "I own these functions:";

if (IntentBug_TargetView has :vivoactivehr_code){
whichCodesDoIHave += "\n vivoactivehr_code";
}

if (IntentBug_TargetView has :vivoactive3_code){
whichCodesDoIHave += "\n vivoactive3_code";
}
if (IntentBug_TargetView has :fenix5_code){
whichCodesDoIHave += "\n fenix5_code";
}

dc.setColor(Gfx.COLOR_BLACK, Gfx.COLOR_BLACK);
dc.clear();
dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_BLACK);
dc.drawText(dc.getWidth()/2, dc.getHeight()/2, Gfx.FONT_SMALL, whichCodesDoIHave, Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER);

}

(:i_am_a_vivoactive_hr) function vivoactivehr_code(){
}

(:i_am_a_vivoactive3) function vivoactive3_code(){
}

(:i_am_a_fenix5) function fenix5_code(){
}
}







IntentBug_CallerView.mc

using Toybox.WatchUi;
using Toybox.System as Sys;

class IntentBug_CallerView extends WatchUi.View {

function initialize() {
View.initialize();
}
function onLayout(dc){}
function onShow(){}
function onHide(){}


function onUpdate(dc) {
View.onUpdate(dc);
// Just call the target app (using the correct manifest-id):
Sys.exitTo(new Sys.Intent("manifest-id://fb4da7ad-d875-4c74-824d-45a4a316e57b", {"dummy" => "dummy"}));
}
}
  • Former Member
    Former Member
    I think you may want to send your test apps to the CIQ mailbox with some detailed reproduction steps, because what you are describing does not jive with what I know about how the simulator works.

    Is this an accurate description of what you are describing?
    Run App B built for Product 1 directly.
    Run App A built for Product 1 directly.
    Intent to App B from App A built for Product 1.
    Simulator runs App B built for Product 2.

    The simulator does not keep multiple versions of an application that has been sent to it. If you send App A built for VVA3 to the simulator, and then send App A built for Fenix 5 to the simulator, the version built for VVA3 will be overwritten, and will no longer exist from the perspective of the simulator. The simulator is also not in any way capable of building an application for a target, or requesting an application built for a target from the eclipse environment.

    If you intent from App A to App B the only version of App B the simulator can run is the most recent version of App B that was pushed to it.
  • Just out of curiosity, I tried the repro procedure in the OP with the latest SDK on Windows.

    1) Ran App B directly
    2) Ran App A to launch App B

    I had the following results for 2)
    - If App B had not previously been run, then App A crashed with an exception ("The target app is not installed"), as expected.
    - If App B had previously been run for device X, then App B (device X) would be run again. (As expected.)

    Under no circumstances was I able to observe the "default build" of the app running in the simulator.

    The only way I managed to see the default build running in the sim was to trigger an automatic build and manually copy the PRG from PROJECT_DIR/bin to the simulator APPS/ folder. I wonder if there's some edge case where this actually happens automatically when it shouldn't.
  • You're right. The information I wrote in my previous post wasn't correct, so I deleted it. The sim always uses the latest build of AppB, so the problem only occurs if you change the device.

    If I could I'd change the title of this topic. I'd replace "major" by "minor" :-)