File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
interop/src/clients/corecrypto Expand file tree Collapse file tree 4 files changed +10
-15
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 @@ -6,12 +6,11 @@ if [[ "${GITHUB_ACTIONS}" == "true" ]]; then
66 sh ./setup-android-emulator.sh
77fi
88
9- ./start-android-emulator.sh
9+ eval " $( ./start-android-emulator.sh | grep ' ^ADB_DEVICE= ' ) "
1010
1111cleanup () {
1212 echo " Shutting down Android emulator via adb"
13- adb_device=emulator-$(( 27000 + $(id - u)) )
14- $ANDROID_HOME /platform-tools/adb -s $adb_device emu kill
13+ $ANDROID_HOME /platform-tools/adb -s " $ADB_DEVICE " emu kill
1514}
1615
1716trap cleanup EXIT
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ cleanup() {
1414 fi
1515
1616 echo " Shutting down Android emulator via adb"
17- adb_device=emulator-$(( 27000 + $(id - u)) )
18- adb -s $adb_device emu kill
17+ adb -s $ADB_DEVICE emu kill
1918}
2019
2120trap cleanup EXIT
@@ -37,7 +36,7 @@ if [ "$OS" = "Darwin" ]; then
3736 cd $scripts
3837fi
3938
40- ./start-android-emulator.sh
39+ eval " $( ./start-android-emulator.sh | grep ' ^ADB_DEVICE= ' ) "
4140
4241cd ../interop/src/clients
4342
Original file line number Diff line number Diff line change @@ -56,3 +56,5 @@ until adb -s $ADB_DEVICE shell getprop sys.boot_completed | grep -qm 1 '1'; do
5656done
5757
5858echo " Emulator started. PID: $EMULATOR_PID "
59+
60+ echo " ADB_DEVICE=$ADB_DEVICE "
You can’t perform that action at this time.
0 commit comments