-
-
Notifications
You must be signed in to change notification settings - Fork 427
Android: Assets collection logic #6545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
562ac2b to
30213b2
Compare
|
|
||
| override def androidVirtualDevice = super.androidVirtualDevice().withName("java-test") | ||
| override def androidVirtualDevice = super.androidVirtualDevice().withName("java-r8-test") | ||
| override def androidEmulatorPort = "5556" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since #6486, we should be able to use build.example.testPort or PORT env variable.
Lines 255 to 262 in bc6f01a
| /** | |
| * Unique port for this example test module. | |
| * Each module claims a port by incrementing the shared counter. | |
| * This ensures each example test gets a distinct port for parallel execution. | |
| */ | |
| val testPort: Int = portCounter.getAndIncrement() | |
| def forkEnv = Map("LANG" -> "C", "PORT" -> testPort.toString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caveat with build.example.testPorts logic, is that android emulators require an even port number between a certain range, in order to be visible to adb (https://developer.android.com/studio/run/emulator-commandline#common)
Note that if the port value is not even and is in the range 5554 to 5584, the virtual device will start but not be visible when you use the adb devices command, if the adb server starts after the emulator. For this reason, we recommend using an even console port number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@souvlakias we can customise the testPort to follow the even port logic I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try editing this
Line 143 in bc6f01a
| trait ExampleCrossModuleAndroid extends ExampleCrossModule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that really say the ports must be between 5554 and 5584? I'm not a native English speaker, so hard to tell, but it sound like it's just a suggestion to reduce impact by other assumptions.
For the even port number, you could acquire ports consecutively (run testPort repeatedly), until you get an even number, and then run it once more, to ensure the port + 1 is also reserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC it is a suggestion yes, to catch the case of the adb server being started after the emulator. Thus, it does concern us since the adb server will run the first time we run any adb command which in our cases, happens after the calls of avd and emulator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add this explanation and the link to the emulator port method
This makes the Jetcaster.wear sample functional (Repo)
Closes #6544
Collects the
assetsdirectory from dependencies and passes them toaapt2 link