Skip to content
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

x/mobile: [Query] Launch a android application with given package name [String] in go #33824

Closed
jay11ca39 opened this issue Aug 25, 2019 · 1 comment
Labels
Milestone

Comments

@jay11ca39
Copy link

@jay11ca39 jay11ca39 commented Aug 25, 2019

What version of Go are you using (go version)?

$ go version: go1.12.4 linux/amd64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GOARCH="amd64"
GOBIN="/usr/local/go"
GOCACHE="/home/--/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="My Go path"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build242944229=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Hello All,

Following is the function written in go:

func LaunchApplication(packageName string) {
 Query :
 how can I execute application with given packageName

}

Generated the java binding [.aar] using gomobile.
I want to include .aar generated in my android application and call LaunchApplication("com.package.name") from java layer to native go layer and go layer should run the application.

In java application, following is the way to run apk using package name:
Process process = Runtime.getRuntime().exec("am start -n com.package.name/com.package.name.ActivityName");

I tried the same in go using:
os.exec() function but it is giving error that "am not found in the $PATH"

Is there is any way to do that ?

@gopherbot gopherbot added this to the Unreleased milestone Aug 25, 2019
@gopherbot gopherbot added the mobile label Aug 25, 2019
@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Aug 25, 2019

Hello @jay11ca39, unlike other projects, we do not use the issue tracker for questions such as these. It is only used for bugs and feature proposals. I will close this issue, but please feel free to ask it in any of these forums below:

Thanks

@agnivade agnivade closed this Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.