Upload Application
7 min
use this method to upload an apk or ipa artifact that will be used by your test system the sdk sends the file as a binary stream do not convert the file to base64 or wrap it in json before you begin confirm that the apk or ipa is readable by the test runner choose a meaningful version label for the build keep the source stream open until the upload method completes enable image injection only when the test workflow requires device park gadget injection sdk method java node js client applications() upload(stream, filename, version, imageinjection) await client applications() upload(stream, filename, version, imageinjection?) both sdks keep the three parameter call for normal uploads imageinjection defaults to false parameters parameter required description stream yes readable apk or ipa stream filename yes original file name version yes version label, maximum 50 characters imageinjection no enables configured gadget injection; default false standard upload try (inputstream input = files newinputstream(paths get("/path/to/mobile app apk"))) { application application = client applications() upload( input, "mobile app apk", "1 0 0" ); system out println(application filekey()); }import { createreadstream } from "node\ fs"; const application = await client applications() upload( createreadstream("/path/to/mobile app apk"), "mobile app apk", "1 0 0" ); console log(application filekey); upload with image injection use image injection only when the test scenario depends on device park gadget injection try (inputstream input = files newinputstream(paths get("/path/to/mobile app apk"))) { application application = client applications() upload( input, "mobile app apk", "1 0 0", true ); }import { createreadstream } from "node\ fs"; const application = await client applications() upload( createreadstream("/path/to/mobile app apk"), "mobile app apk", "1 0 0", true ); omit imageinjection or pass false for a standard upload passing true changes upload processing and should be enabled only for workflows that require it result store filekey ; it is the stable application identifier downloadurl may expire and should not replace filekey in your data model the caller owns the input stream lifecycle java should use try with resources uploading stores the application artifact device installation and test session behavior are separate steps controlled by the consuming test flow image injection changes upload processing only passing false or omitting the parameter preserves the standard upload behavior next step list applications /applications/list applications to inspect the stored revision or keep the returned filekey in the test configuration
