2
0
mirror of synced 2025-02-23 14:58:12 +00:00

mobile: cache debug.keystore to avoid adb install certificate errors

Otherwise, successive adb installs will require the existing apk to be
removed. If no android.keystore is generated during docker build, one
will be generated by the NDK toolchain during docker run.
It will end up the applications are being signed with different
certificates on each docker run.

Fixes #9498.

Change-Id: Ibac202b828224287ec6fdc3eaff659de5fce61c3
Reviewed-on: https://go-review.googlesource.com/2266
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Burcu Dogan 2015-01-03 11:42:09 -08:00
parent 3d879bb1b3
commit 1e525d6eb2

View File

@ -59,4 +59,8 @@ RUN curl -L https://github.com/golang/go/archive/master.zip -o /tmp/go.zip && \
./all.bash && \ ./all.bash && \
CC_FOR_TARGET=$NDK_ROOT/bin/arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 ./make.bash CC_FOR_TARGET=$NDK_ROOT/bin/arm-linux-androideabi-gcc GOOS=android GOARCH=arm GOARM=7 ./make.bash
# Generate a debug keystore to avoid it being generated on each `docker run`
# and fail `adb install -r <apk>` with a conflicting certificate error.
RUN keytool -genkeypair -alias androiddebugkey -keypass android -keystore ~/.android/debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 365
WORKDIR $GOPATH/src/golang.org/x/mobile WORKDIR $GOPATH/src/golang.org/x/mobile