File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
interop/src/clients/corecrypto Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -196,15 +196,10 @@ impl CoreCryptoAndroidClient {
196196 let client_id_base64 = general_purpose:: STANDARD . encode ( client_id_str. as_str ( ) ) ;
197197 let ciphersuite = CIPHERSUITE_IN_USE as u16 ;
198198
199- let output = Command :: new ( "adb" )
200- . args ( [ "get-serialno" ] )
201- . output ( )
202- . expect ( "Failed to get connected android device" ) ;
203-
204- let device = String :: from_utf8 ( output. stdout )
205- . expect ( "output is not valid utf8" )
206- . trim ( )
207- . to_string ( ) ;
199+ let device = std:: env:: var_os ( "ADB_DEVICE" )
200+ . expect ( "ADB_DEVICE must be set" )
201+ . into_string ( )
202+ . expect ( "ADB_DEVICE must have valid string encoding" ) ;
208203 let driver = SimulatorDriver :: new ( device, "com.wire.androidinterop" . into ( ) ) ;
209204 log:: info!( "initialising core crypto with ciphersuite {ciphersuite}" ) ;
210205 driver
Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ cd $scripts
55
66TARGET_NAME=$1
77
8+ export ADB_DEVICE_PORT=$(( 27000 + $(id - u)) )
9+ export ADB_DEVICE=emulator-$ADB_DEVICE_PORT
10+
811OS=" $( uname -s) "
912
1013cleanup () {
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ AVD_NAME=test-phone
99# multiple jobs running at the same time, all using the same adb server, and
1010# therefore seeing the same emulator devices. To avoid that, just pick a port
1111# based on current user's ID.
12- PORT=$(( 27000 + $(id - u)) )
13- ADB_DEVICE=emulator-$PORT
1412
1513# PATH updates
1614export PATH=$ANDROID_HOME /cmdline-tools/latest/bin:$ANDROID_HOME /platform-tools:$ANDROID_HOME /emulator:$PATH
4442# not be running on our self-hosted runners.
4543adb start-server
4644
47- emulator -avd $AVD_NAME -port $PORT -no-window -gpu swiftshader_indirect \
45+ emulator -avd $AVD_NAME -port $ADB_DEVICE_PORT -no-window -gpu swiftshader_indirect \
4846 -no-snapshot -noaudio -no-boot-anim -no-metrics > $logfile &
4947EMULATOR_PID=$!
5048
You can’t perform that action at this time.
0 commit comments